Analysis

Author

ak

#Load libraries
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.3     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(lme4)
Warning: package 'lme4' was built under R version 4.3.2
Loading required package: Matrix
Warning: package 'Matrix' was built under R version 4.3.2

Attaching package: 'Matrix'

The following objects are masked from 'package:tidyr':

    expand, pack, unpack
library(ggfortify)
Warning: package 'ggfortify' was built under R version 4.3.2
library(lmerTest)
Warning: package 'lmerTest' was built under R version 4.3.2

Attaching package: 'lmerTest'

The following object is masked from 'package:lme4':

    lmer

The following object is masked from 'package:stats':

    step
library(performance)
Warning: package 'performance' was built under R version 4.3.2
library(readr)
#install.packages("broom.mixed")
library(broom.mixed)
Warning: package 'broom.mixed' was built under R version 4.3.2
library(grid)
droughtnet <- read_csv("droughtnet_data_cleaned_final.csv", 
                 col_types = cols(calluna_shoot_type = col_factor(levels = c("Long", "Short"))),
                 guess_max = Inf)

View(droughtnet)
# Now, to reorder the ageClass factor levels to start with Pioneer
droughtnet$ageClass <- factor(droughtnet$ageClass, levels = c("Mature", "Pioneer"))
levels(droughtnet$ageClass)
[1] "Mature"  "Pioneer"
droughtnet2 <- droughtnet %>%
  mutate(plant_nr = case_when(
    # For Calluna vulgaris under Amb (0) treatment
    siteID %in% c("Lygra", "Tjøtta") & 
    ageClass %in% c("Pioneer", "Mature") & 
    species == "Calluna vulgaris" & 
    DroughtTrt == "Amb (0)" ~ paste0(siteID, "_", ageClass, "_CV_Amb(0)_", DroughNet_plotID, "_", plant_nr),

    # For Calluna vulgaris under Ext (90) treatment
    siteID %in% c("Lygra", "Tjøtta") & 
    ageClass %in% c("Pioneer", "Mature") & 
    species == "Calluna vulgaris" & 
    DroughtTrt == "Ext (90)" ~ paste0(siteID, "_", ageClass, "_CV_Ext(90)_", DroughNet_plotID, "_", plant_nr),

    # For Vaccinium myrtillus under Amb (0) treatment
    siteID %in% c("Lygra", "Tjøtta") & 
    ageClass %in% c("Pioneer", "Mature") & 
    species == "Vaccinium myrtillus" & 
    DroughtTrt == "Amb (0)" ~ paste0(siteID, "_", ageClass, "_VM_Amb(0)_", DroughNet_plotID, "_", plant_nr),

    # For Vaccinium myrtillus under Ext (90) treatment
    siteID %in% c("Lygra", "Tjøtta") & 
    ageClass %in% c("Pioneer", "Mature") & 
    species == "Vaccinium myrtillus" & 
    DroughtTrt == "Ext (90)" ~ paste0(siteID, "_", ageClass, "_VM_Ext(90)_", DroughNet_plotID, "_", plant_nr),

    # For Vaccinium vitis-idaea under Amb (0) treatment
    siteID %in% c("Lygra", "Tjøtta") & 
    ageClass %in% c("Pioneer", "Mature") & 
    species == "Vaccinium vitis-idaea" & 
    DroughtTrt == "Amb (0)" ~ paste0(siteID, "_", ageClass, "_VV_Amb(0)_", DroughNet_plotID, "_", plant_nr),

    # For Vaccinium vitis-idaea under Ext (90) treatment
    siteID %in% c("Lygra", "Tjøtta") & 
    ageClass %in% c("Pioneer", "Mature") & 
    species == "Vaccinium vitis-idaea" & 
    DroughtTrt == "Ext (90)" ~ paste0(siteID, "_", ageClass, "_VV_Ext(90)_", DroughNet_plotID, "_", plant_nr),

    # For Empetrum nigrum under Amb (0) treatment
    siteID %in% c("Lygra", "Tjøtta") & 
    ageClass %in% c("Pioneer", "Mature") & 
    species == "Empetrum nigrum" & 
    DroughtTrt == "Amb (0)" ~ paste0(siteID, "_", ageClass, "_EN_Amb(0)_", DroughNet_plotID, "_", plant_nr),

    # For Empetrum nigrum under Ext (90) treatment
    siteID %in% c("Lygra", "Tjøtta") & 
    ageClass %in% c("Pioneer", "Mature") & 
    species == "Empetrum nigrum" & 
    DroughtTrt == "Ext (90)" ~ paste0(siteID, "_", ageClass, "_EN_Ext(90)_", DroughNet_plotID, "_", plant_nr),

    # Default case if none of the above conditions are met
    TRUE ~ as.character(plant_nr)
  ))
view(droughtnet2)
# Specify the columns to check for NA values
# List of columns to check for NA values
columns_to_check <- c("DroughtTrt", "DroughNet_plotID", "ageClass", "siteID", 
                      "species", "plant_height", "SLA", "mean_thickness", "dry_mass_g_original", "LDMC", "leaf_area", "wet_mass_g", "dry_mass_g")


# Check for rows with any NA values in the specified columns
na_rows <- apply(droughtnet2[columns_to_check], 1, function(row) any(is.na(row)))

# Create a data frame showing how many NA values there are in each row
na_row_summary <- droughtnet2[na_rows, columns_to_check]
na_row_summary$row_na_count <- rowSums(is.na(na_row_summary))

# Summarize the number of rows by the count of NAs they contain
na_row_summary <- na_row_summary %>%
  group_by(row_na_count) %>%
  summarise(n = n(), .groups = 'drop')

# Create a summary showing the co-occurrence of NA values across the specified columns
na_co_occurrence <- droughtnet2 %>%
  summarise(across(all_of(columns_to_check), ~ sum(is.na(.)))) %>%
  pivot_longer(cols = everything(), names_to = "variable", values_to = "na_count") %>%
  arrange(desc(na_count))

# Print the summaries
print(paste("Total rows with any NA values across checked columns:", sum(na_rows)))
[1] "Total rows with any NA values across checked columns: 50"
print(na_row_summary)
# A tibble: 4 × 2
  row_na_count     n
         <dbl> <int>
1            1     9
2            2    32
3            4     2
4            5     7
print(na_co_occurrence)
# A tibble: 13 × 2
   variable            na_count
   <chr>                  <int>
 1 SLA                       37
 2 leaf_area                 36
 3 LDMC                      13
 4 wet_mass_g                12
 5 plant_height               9
 6 dry_mass_g                 8
 7 dry_mass_g_original        1
 8 DroughtTrt                 0
 9 DroughNet_plotID           0
10 ageClass                   0
11 siteID                     0
12 species                    0
13 mean_thickness             0
# Create the new data frame with selected columns
droughtnet_data2 <- select(droughtnet2, 
                           "envelope_ID", "siteID", "species", "ageClass", "DroughtTrt", 
                           "DroughNet_plotID", "leaf_age", "calluna_shoot_type", 
                           "plant_height", "mean_thickness", "SLA", "LDMC", "plant_nr")

view(droughtnet_data2)

# Specify the columns to check for NA values
columns_to_check2 <- c("plant_height", "mean_thickness", "SLA", "LDMC")

# Remove rows with any NA values in the specified columns
droughtnet_data2_clean <- droughtnet_data2[!rowSums(is.na(droughtnet_data2[columns_to_check2])), ]
view(droughtnet_data2_clean)
# Calculate the total number of NAs removed (for the specified columns only)
# This calculation considers rows removed rather than individual NAs
total_NAs_removed <- nrow(droughtnet_data2) - nrow(droughtnet_data2_clean)

# Calculate the total number of entries remaining
total_entries_remaining <- nrow(droughtnet_data2_clean)

# Print out the total NAs removed and total entries remaining
cat("Total NAs removed:", total_NAs_removed, "\n")
Total NAs removed: 50 
cat("Total entries remaining:", total_entries_remaining, "\n")
Total entries remaining: 1265 

Analysis for young leaves

# Specify the species of interest, including Calluna vulgaris
species_of_interest <- c("Empetrum nigrum", "Vaccinium myrtillus", "Vaccinium vitis-idaea", "Calluna vulgaris")

# Filter the data to include only the specified species where leaf_age is 'young',
# and for Calluna vulgaris, additionally check that calluna_shoot_type is 'short'

filtered_data <- droughtnet_data2_clean %>%
  filter(species %in% species_of_interest, leaf_age == "young") %>%
  filter(
    # Include Calluna vulgaris from Tjøtta regardless of calluna_shoot_type
    (species == "Calluna vulgaris" & siteID == "Tjøtta") |
    # Include Calluna vulgaris from Lygra only if calluna_shoot_type is Short
    (species == "Calluna vulgaris" & siteID == "Lygra" & calluna_shoot_type == "Short") |
    # Include other species of interest from both sites
    (species != "Calluna vulgaris")
  )

  
view(filtered_data)
p <- ggplot(filtered_data, aes(x = as.factor(plant_nr), y = mean_thickness, color = DroughtTrt)) +
  geom_point() +  # Use geom_point for individual observations
  facet_wrap(~ ageClass + siteID, scales = "free", nrow = 2) +  # Adjusted for clearer separation
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  labs(title = "thickness Response to Treatment",
       x = "Plant Number",
       y = "thickness",  # Assuming height is in centimeters
       color = "Drought Treatment")  # Adjusted label


ggsave("thickness_plot.png", plot = p, width = 10, height = 8, dpi = 300)

plots

plant height

filtered_data  <- filtered_data  %>%
  filter(siteID %in% c("Tjøtta", "Lygra"),
         DroughtTrt %in% c("Amb (0)", "Ext (90)"),
         ageClass %in% c("Pioneer", "Mature"))

ggplot(filtered_data, aes(x = species, y = plant_height, fill = DroughtTrt)) +
  geom_boxplot() +
  facet_grid(ageClass ~ siteID, scales = "free") +  # Removed leaf_age from facet_grid
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  labs(title = "Plant Height vs Treatment by Species for Young Leaves",
       x = "Species",
       y = "Plant Height") +
  scale_fill_manual(values = c("Amb (0)" = "blue", "Ext (90)" = "grey"))  # Assigning colors to treatments

SLA

ggplot(filtered_data, aes(x = species, y = log(SLA), fill = DroughtTrt)) +
  geom_boxplot() +
  facet_grid(ageClass ~ siteID, scales = "free") + 
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1), # vertical adjustment for x axis labels
        plot.caption = element_text(hjust = 0.5)) + # Center the caption
  labs(title = "SLA vs Treatment by Species",
       x = "Species",
       y = "Log (SLA)",
       fill = "Drought Treatment",
       caption = "Figure 2: SLA Variation in Dwarf Shrubs Under Drought Conditions Across Different Ages and Sites") +
  scale_fill_manual(values = c("Amb (0)" = "orange", "Ext (90)" = "darkgrey")) # Assigning colors to treatments

LDMC

ggplot(filtered_data, aes(x = species, y = LDMC, fill = DroughtTrt)) +
  geom_boxplot() +
  facet_grid(ageClass ~ siteID, scales = "free") + 
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1), # vertical adjustment for x axis labels
        plot.caption = element_text(hjust = 0.5)) + # Center the caption
  labs(title = "LDMC vs Treatment by Species",
       x = "Species",
       y = "LDMC",
       fill = "Drought Treatment",
       caption = "Figure 3: LDMC Variation in dwarf Shrubs Under drought conditions across different successional phases and sites") +
  scale_fill_manual(values = c("Amb (0)" = "darkblue", "Ext (90)" = "lightblue")) # Assigning colors to treatments

#trying using jitter for the graphs
ggplot(filtered_data, aes(x = species, y = LDMC, color = DroughtTrt)) +
  geom_jitter(position = position_dodge(width = 0.5), size = 1.5, alpha = 0.7) + # Use position_dodge to separate points
  facet_grid(ageClass ~ siteID, scales = "free") + 
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1), # Vertical adjustment for x axis labels
        plot.caption = element_text(hjust = 0.5)) + # Center the caption
  labs(title = "LDMC vs Treatment by Species",
       x = "Species",
       y = "LDMC",
       color = "Drought Treatment", # Updated from fill to color
       caption = "Figure 3: LDMC Variation in Dwarf Shrubs Under Drought Conditions Across Different Successional Phases and Sites") +
  scale_color_manual(values = c("Amb (0)" = "darkblue", "Ext (90)" = "red")) # Assigning colors to treatments

Mean_thickness

filtered_data  <- filtered_data  %>%
  filter(siteID %in% c("Tjøtta", "Lygra"),
         DroughtTrt %in% c("Amb (0)", "Ext (90)"),
         ageClass %in% c("Pioneer", "Mature"))

ggplot(filtered_data, aes(x = species, y = mean_thickness, fill = DroughtTrt)) +
  geom_boxplot() +
  facet_grid(ageClass ~ siteID, scales = "free") +  # Removed leaf_age from facet_grid
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  labs(title = "Plant Height vs Treatment by Species for Young Leaves",
       x = "Species",
       y = "mean_thickness") +
  scale_fill_manual(values = c("Amb (0)" = "blue", "Ext (90)" = "grey"))  # Assigning colors to treatments

Analysis for lygra site

filter data only for lygra

# Filter the data for siteID Lygra
lygra_data <- filtered_data %>%
  filter(siteID == "Lygra")
view(lygra_data)

Trait 1- LDMC- models

lygra_data$plant_nr <- as.factor(lygra_data$plant_nr)
# fitting a linear mixed-effects model using lmer, plant nr is the nested random effect
# Ensure variables are treated as categorical if they represent categories
lygra_data$plant_nr <- as.factor(lygra_data$plant_nr)

# Model with all the main effects for LDMC
LY_model_main_effects_LDMC <- lmer(LDMC ~ species + DroughtTrt + ageClass +
                                (1 | DroughNet_plotID/plant_nr),
                                data = lygra_data)
summary(LY_model_main_effects_LDMC)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
LDMC ~ species + DroughtTrt + ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 3697.4

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.0698 -0.4306  0.0023  0.3775  4.6922 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1706.15  41.306  
 DroughNet_plotID          (Intercept)    7.11   2.667  
 Residual                              1495.66  38.674  
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                             Estimate Std. Error      df t value Pr(>|t|)    
(Intercept)                   347.948      9.927  27.836  35.051  < 2e-16 ***
speciesEmpetrum nigrum         24.993     11.850 118.372   2.109  0.03703 *  
speciesVaccinium myrtillus      3.750     12.175 119.802   0.308  0.75860    
speciesVaccinium vitis-idaea  -54.351     11.604 111.583  -4.684    8e-06 ***
DroughtTrtExt (90)              2.925      8.768   9.559   0.334  0.74586    
ageClassPioneer                30.709      8.859   9.960   3.466  0.00609 ** 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90
spcsEmptrmn -0.495                            
spcsVccnmmy -0.528  0.448                     
spcsVccvts- -0.553  0.448  0.435              
DrghtTE(90) -0.402  0.035  0.102 -0.041       
ageClassPnr -0.404 -0.122 -0.081  0.061 -0.090
#validate model
performance::check_model(LY_model_main_effects_LDMC, detrend = FALSE)

view(lygra_data)

# Extract coefficients to a data frame

2-way interactions

#species * DroughtTrt
LY_LDMC_species_droughtTrt <- lmer(LDMC ~ species * DroughtTrt +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)

summary(LY_LDMC_species_droughtTrt )
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: LDMC ~ species * DroughtTrt + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 3674.6

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.7984 -0.3873  0.0066  0.3684  4.5793 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1515.9   38.93   
 DroughNet_plotID          (Intercept)  258.6   16.08   
 Residual                              1492.7   38.63   
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                                Estimate Std. Error     df
(Intercept)                                       352.60      12.57  38.43
speciesEmpetrum nigrum                             61.33      15.82 113.77
speciesVaccinium myrtillus                         21.81      15.33 113.38
speciesVaccinium vitis-idaea                      -62.83      16.19 108.94
DroughtTrtExt (90)                                 24.28      17.77  38.37
speciesEmpetrum nigrum:DroughtTrtExt (90)         -67.71      22.86 114.78
speciesVaccinium myrtillus:DroughtTrtExt (90)     -37.11      23.94 115.79
speciesVaccinium vitis-idaea:DroughtTrtExt (90)    12.53      22.26 108.24
                                                t value Pr(>|t|)    
(Intercept)                                      28.046  < 2e-16 ***
speciesEmpetrum nigrum                            3.877 0.000177 ***
speciesVaccinium myrtillus                        1.423 0.157597    
speciesVaccinium vitis-idaea                     -3.880 0.000179 ***
DroughtTrtExt (90)                                1.366 0.179897    
speciesEmpetrum nigrum:DroughtTrtExt (90)        -2.962 0.003717 ** 
speciesVaccinium myrtillus:DroughtTrtExt (90)    -1.550 0.123894    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   0.563 0.574834    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.579                                          
spcsVccnmmy -0.597  0.476                                   
spcsVccvts- -0.564  0.441  0.461                            
DrghtTE(90) -0.707  0.409  0.422  0.399                     
sEn:DTE(90)  0.400 -0.692 -0.330 -0.305 -0.565              
sVm:DTE(90)  0.382 -0.305 -0.640 -0.295 -0.540  0.442       
sVv-:DTE(90  0.410 -0.321 -0.336 -0.727 -0.580  0.445  0.428
#validate model
performance::check_model(LY_LDMC_species_droughtTrt, detrend = FALSE)

#blme package- install
 #install.packages("blme")

library(blme)
Warning: package 'blme' was built under R version 4.3.3
model <- blmer(LDMC ~ species * DroughtTrt + 
                 (1 | DroughNet_plotID), 
                  data = lygra_data)


 
# Examine the summary of the model
summary(model)
Cov prior  : DroughNet_plotID ~ wishart(df = 3.5, scale = Inf, posterior.scale = cov, common.scale = TRUE)
Prior dev  : 2.8485

Linear mixed model fit by REML ['blmerMod']
Formula: LDMC ~ species * DroughtTrt + (1 | DroughNet_plotID)
   Data: lygra_data

REML criterion at convergence: 3751.6

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.2662 -0.6069  0.0163  0.5299  4.5670 

Random effects:
 Groups           Name        Variance Std.Dev.
 DroughNet_plotID (Intercept)  430.5   20.75   
 Residual                     2875.6   53.62   
Number of obs: 351, groups:  DroughNet_plotID, 12

Fixed effects:
                                                Estimate Std. Error t value
(Intercept)                                       353.67      11.37  31.101
speciesEmpetrum nigrum                             61.33      11.27   5.443
speciesVaccinium myrtillus                         22.20      10.98   2.022
speciesVaccinium vitis-idaea                      -61.19      11.31  -5.410
DroughtTrtExt (90)                                 23.02      16.08   1.431
speciesEmpetrum nigrum:DroughtTrtExt (90)         -68.08      16.32  -4.171
speciesVaccinium myrtillus:DroughtTrtExt (90)     -38.80      17.11  -2.267
speciesVaccinium vitis-idaea:DroughtTrtExt (90)    11.18      15.56   0.718

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.452                                          
spcsVccnmmy -0.462  0.476                                   
spcsVccvts- -0.446  0.439  0.457                            
DrghtTE(90) -0.707  0.320  0.326  0.315                     
sEn:DTE(90)  0.312 -0.690 -0.329 -0.303 -0.440              
sVm:DTE(90)  0.296 -0.306 -0.642 -0.293 -0.419  0.450       
sVv-:DTE(90  0.324 -0.319 -0.332 -0.727 -0.459  0.443  0.426
names(lygra_data)
 [1] "envelope_ID"        "siteID"             "species"           
 [4] "ageClass"           "DroughtTrt"         "DroughNet_plotID"  
 [7] "leaf_age"           "calluna_shoot_type" "plant_height"      
[10] "mean_thickness"     "SLA"                "LDMC"              
[13] "plant_nr"          

plot model onto the ggplot

ggplot(lygra_data, aes(x = species, y = LDMC, fill = DroughtTrt)) +
  geom_boxplot() +
  facet_grid(~ ageClass, scales = "free") +  # Facet only by ageClass
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1), # vertical adjustment for x axis labels
        plot.caption = element_text(hjust = 0.5)) + # Center the caption
  labs(title = "LDMC vs Treatment by Species",
       x = "Species",
       y = "LDMC",
       fill = "Drought Treatment",
       caption = "Figure 3: LDMC Variation in Dwarf Shrubs Under Drought Conditions Across Different Successional Phases") +
  scale_fill_manual(values = c("Amb (0)" = "darkblue", "Ext (90)" = "lightblue"))

#fit model

# Get fitted values directly from the model
fitted_values <- predict(LY_LDMC_species_droughtTrt, re.form = NA)  

lygra_data$fitted <- fitted_values

# Assuming fitted_values has been added to filtered_data as shown above
ggplot(lygra_data, aes(x = species, y = LDMC, fill = DroughtTrt)) +
  geom_boxplot() +
  geom_point(aes(y = fitted), position = position_dodge(width = 0.75), color = "red", size = 1.5) + # Add fitted values
  facet_grid(~ ageClass, scales = "free") + # Facet only by ageClass
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1), # Vertical adjustment for x axis labels
        plot.caption = element_text(hjust = 0.5)) + 
  labs(title = "LDMC vs Treatment by Species",
       x = "Species",
       y = "LDMC",
       fill = "Drought Treatment",
       caption = "Figure 3: LDMC Variation in Dwarf Shrubs Under Drought Conditions Across Different Successional Phases") +
  scale_fill_manual(values = c("Amb (0)" = "darkblue", "Ext (90)" = "lightblue"))

#fiiting in the geom jitter plot

# Get fitted values directly from the model
fitted_values <- predict(LY_LDMC_species_droughtTrt, re.form = NA)  

# Assuming 'fitted_values' is a vector of the same length as 'lygra_data'
lygra_data$fitted <- fitted_values

fitted_values$dodge_position <- as.numeric(lygra_data$DroughtTrt) - 1.5
Warning: NAs introduced by coercion
Warning in fitted_values$dodge_position <- as.numeric(lygra_data$DroughtTrt) -
: Coercing LHS to a list
ggplot(lygra_data, aes(x = species, y = LDMC, group = DroughtTrt)) +
  geom_jitter(aes(color = DroughtTrt), position = position_dodge(width = 0.5), size = 1.5, alpha = 0.7) +
  geom_point(aes(y = fitted, color = DroughtTrt),  # Ensure 'fitted' is now recognized
             position = position_dodge(width = 0.5), size = 3, shape = 16, color = "black") +
  facet_grid(ageClass ~ siteID, scales = "free") +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)) +
  labs(title = "LDMC vs Treatment by Species", x = "Species", y = "LDMC", color = "Drought Treatment") +
  scale_color_manual(values = c("Amb (0)" = "darkgreen", "Ext (90)" = "deeppink"))

# species * age Class (h2)xxx
#this will help adress the hypothesis by examining weather the effect of drought on trait varies between age classes
#significant interaction supports the hypothesis that mat and pio respond differently to droght conditions, potentially more consrvative traits in mat than pio
LY_LDMC_species_ageClass <- lmer(LDMC ~ species * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)

summary(LY_LDMC_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: LDMC ~ species * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 3674.6

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.1127 -0.4217  0.0167  0.3948  4.7547 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1638.37  40.477  
 DroughNet_plotID          (Intercept)   27.15   5.211  
 Residual                              1494.44  38.658  
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                             Estimate Std. Error     df t value
(Intercept)                                    353.04      11.21  68.92  31.500
speciesEmpetrum nigrum                          41.33      18.45 116.03   2.240
speciesVaccinium myrtillus                     -12.12      18.01 127.69  -0.673
speciesVaccinium vitis-idaea                   -65.18      15.49 107.28  -4.207
ageClassPioneer                                 23.43      15.89  69.55   1.475
speciesEmpetrum nigrum:ageClassPioneer         -22.52      23.94 116.33  -0.941
speciesVaccinium myrtillus:ageClassPioneer      27.31      24.11 120.33   1.133
speciesVaccinium vitis-idaea:ageClassPioneer    25.06      22.96 109.35   1.091
                                             Pr(>|t|)    
(Intercept)                                   < 2e-16 ***
speciesEmpetrum nigrum                          0.027 *  
speciesVaccinium myrtillus                      0.502    
speciesVaccinium vitis-idaea                  5.4e-05 ***
ageClassPioneer                                 0.145    
speciesEmpetrum nigrum:ageClassPioneer          0.349    
speciesVaccinium myrtillus:ageClassPioneer      0.260    
speciesVaccinium vitis-idaea:ageClassPioneer    0.278    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- agClsP sEn:CP sVm:CP
spcsEmptrmn -0.586                                          
spcsVccnmmy -0.600  0.369                                   
spcsVccvts- -0.697  0.424  0.434                            
ageClassPnr -0.705  0.413  0.423  0.492                     
spcsEngr:CP  0.451 -0.771 -0.284 -0.326 -0.640              
spcsVmyr:CP  0.448 -0.276 -0.747 -0.324 -0.635  0.425       
spcsVvt-:CP  0.470 -0.286 -0.293 -0.675 -0.667  0.442  0.439
#validate model
performance::check_model(LY_LDMC_species_ageClass, detrend = FALSE)

#xxxxx
LY_droughtTrt_ageclass <- lmer(LDMC ~ DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)
boundary (singular) fit: see help('isSingular')
summary(LY_droughtTrt_ageclass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: LDMC ~ DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 3747.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.5146 -0.4148 -0.0296  0.3688  4.4122 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 2499     49.99   
 DroughNet_plotID          (Intercept)    0      0.00   
 Residual                              1494     38.66   
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                   Estimate Std. Error      df t value Pr(>|t|)
(Intercept)                         333.020      9.684 124.601  34.387  < 2e-16
DroughtTrtExt (90)                    8.963     14.684 122.837   0.610 0.542734
ageClassPioneer                      50.606     13.644 123.191   3.709 0.000313
DroughtTrtExt (90):ageClassPioneer  -20.814     19.929 122.132  -1.044 0.298355
                                      
(Intercept)                        ***
DroughtTrtExt (90)                    
ageClassPioneer                    ***
DroughtTrtExt (90):ageClassPioneer    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) DrTE(90) agClsP
DrghtTE(90) -0.660                
ageClassPnr -0.710  0.468         
DrTE(90):CP  0.486 -0.737   -0.685
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#plot variance zero
#validate model
performance::check_model(LY_droughtTrt_ageclass, detrend = FALSE)

3-way interaction

LY_LDMC_species__drought_ageClass <- lmer(LDMC ~ species * DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)

summary(LY_LDMC_species__drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
LDMC ~ species * DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 3590.9

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.8653 -0.3969  0.0069  0.3790  4.7004 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1440.48  37.954  
 DroughNet_plotID          (Intercept)   53.17   7.292  
 Residual                              1494.09  38.653  
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                                                Estimate
(Intercept)                                                      345.015
speciesEmpetrum nigrum                                            63.828
speciesVaccinium myrtillus                                       -10.827
speciesVaccinium vitis-idaea                                     -72.342
DroughtTrtExt (90)                                                16.134
ageClassPioneer                                                   15.226
speciesEmpetrum nigrum:DroughtTrtExt (90)                        -49.340
speciesVaccinium myrtillus:DroughtTrtExt (90)                      9.431
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   14.249
speciesEmpetrum nigrum:ageClassPioneer                            -6.113
speciesVaccinium myrtillus:ageClassPioneer                        61.764
speciesVaccinium vitis-idaea:ageClassPioneer                      22.930
DroughtTrtExt (90):ageClassPioneer                                16.148
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        -28.368
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer    -86.081
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   -4.897
                                                                Std. Error
(Intercept)                                                         15.395
speciesEmpetrum nigrum                                              23.636
speciesVaccinium myrtillus                                          21.579
speciesVaccinium vitis-idaea                                        20.875
DroughtTrtExt (90)                                                  21.811
ageClassPioneer                                                     21.877
speciesEmpetrum nigrum:DroughtTrtExt (90)                           35.746
speciesVaccinium myrtillus:DroughtTrtExt (90)                       38.018
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                     29.532
speciesEmpetrum nigrum:ageClassPioneer                              31.363
speciesVaccinium myrtillus:ageClassPioneer                          30.128
speciesVaccinium vitis-idaea:ageClassPioneer                        32.431
DroughtTrtExt (90):ageClassPioneer                                  30.920
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer           46.112
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer       48.862
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer     44.181
                                                                     df t value
(Intercept)                                                      46.203  22.412
speciesEmpetrum nigrum                                          108.896   2.701
speciesVaccinium myrtillus                                      111.493  -0.502
speciesVaccinium vitis-idaea                                    100.684  -3.466
DroughtTrtExt (90)                                               46.548   0.740
ageClassPioneer                                                  47.118   0.696
speciesEmpetrum nigrum:DroughtTrtExt (90)                       107.646  -1.380
speciesVaccinium myrtillus:DroughtTrtExt (90)                   119.205   0.248
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 100.968   0.482
speciesEmpetrum nigrum:ageClassPioneer                          109.218  -0.195
speciesVaccinium myrtillus:ageClassPioneer                      107.590   2.050
speciesVaccinium vitis-idaea:ageClassPioneer                    103.802   0.707
DroughtTrtExt (90):ageClassPioneer                               47.007   0.522
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       108.773  -0.615
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   115.420  -1.762
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer 102.836  -0.111
                                                                Pr(>|t|)    
(Intercept)                                                      < 2e-16 ***
speciesEmpetrum nigrum                                          0.008030 ** 
speciesVaccinium myrtillus                                      0.616851    
speciesVaccinium vitis-idaea                                    0.000779 ***
DroughtTrtExt (90)                                              0.463178    
ageClassPioneer                                                 0.489862    
speciesEmpetrum nigrum:DroughtTrtExt (90)                       0.170357    
speciesVaccinium myrtillus:DroughtTrtExt (90)                   0.804507    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 0.630496    
speciesEmpetrum nigrum:ageClassPioneer                          0.845815    
speciesVaccinium myrtillus:ageClassPioneer                      0.042791 *  
speciesVaccinium vitis-idaea:ageClassPioneer                    0.481114    
DroughtTrtExt (90):ageClassPioneer                              0.603940    
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       0.539717    
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   0.080765 .  
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer 0.911968    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation matrix not shown by default, as p = 16 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it
#validate model
performance::check_model(LY_LDMC_species__drought_ageClass, detrend = FALSE)

Trait 2- SLA

#species * DroughtTrt
LY_SLA_species_droughtTrt <- lmer(log(SLA) ~ species * DroughtTrt +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)

summary(LY_SLA_species_droughtTrt)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(SLA) ~ species * DroughtTrt + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: -141

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-5.2138 -0.3426  0.0206  0.3169  5.1844 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.031393 0.17718 
 DroughNet_plotID          (Intercept) 0.000344 0.01855 
 Residual                              0.020077 0.14169 
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                                 Estimate Std. Error        df
(Intercept)                                       4.30609    0.04708  72.94793
speciesEmpetrum nigrum                            0.39182    0.06787 115.64294
speciesVaccinium myrtillus                        1.18633    0.06627 112.87801
speciesVaccinium vitis-idaea                      0.68292    0.06996 111.20387
DroughtTrtExt (90)                               -0.00846    0.06654  72.82120
speciesEmpetrum nigrum:DroughtTrtExt (90)         0.07050    0.09774 116.59810
speciesVaccinium myrtillus:DroughtTrtExt (90)    -0.07684    0.10243 117.39294
speciesVaccinium vitis-idaea:DroughtTrtExt (90)  -0.17597    0.09639 109.87319
                                                t value Pr(>|t|)    
(Intercept)                                      91.472  < 2e-16 ***
speciesEmpetrum nigrum                            5.773 6.65e-08 ***
speciesVaccinium myrtillus                       17.902  < 2e-16 ***
speciesVaccinium vitis-idaea                      9.762  < 2e-16 ***
DroughtTrtExt (90)                               -0.127   0.8992    
speciesEmpetrum nigrum:DroughtTrtExt (90)         0.721   0.4722    
speciesVaccinium myrtillus:DroughtTrtExt (90)    -0.750   0.4547    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)  -1.826   0.0706 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.676                                          
spcsVccnmmy -0.692  0.480                                   
spcsVccvts- -0.655  0.454  0.465                            
DrghtTE(90) -0.707  0.478  0.490  0.464                     
sEn:DTE(90)  0.469 -0.694 -0.333 -0.315 -0.663              
sVm:DTE(90)  0.448 -0.311 -0.647 -0.301 -0.633  0.434       
sVv-:DTE(90  0.476 -0.329 -0.338 -0.726 -0.672  0.457  0.437
#validate model
performance::check_model(LY_SLA_species_droughtTrt , detrend = FALSE)

# species * age Class xxxxxx

LY_SLA_species_ageClass <- lmer(log(SLA) ~ species * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)
boundary (singular) fit: see help('isSingular')
summary(LY_SLA_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(SLA) ~ species * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: -141.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-5.4035 -0.3534  0.0366  0.3278  5.4292 

Random effects:
 Groups                    Name        Variance  Std.Dev. 
 plant_nr:DroughNet_plotID (Intercept) 3.150e-02 1.775e-01
 DroughNet_plotID          (Intercept) 3.741e-11 6.116e-06
 Residual                              2.008e-02 1.417e-01
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                              Estimate Std. Error        df
(Intercept)                                    4.35771    0.04642 117.44243
speciesEmpetrum nigrum                         0.36904    0.07750 116.45297
speciesVaccinium myrtillus                     1.13907    0.07527 127.22937
speciesVaccinium vitis-idaea                   0.60280    0.06543 115.97599
ageClassPioneer                               -0.11210    0.06577 118.28246
speciesEmpetrum nigrum:ageClassPioneer         0.11155    0.10068 117.54158
speciesVaccinium myrtillus:ageClassPioneer     0.05190    0.10117 122.56535
speciesVaccinium vitis-idaea:ageClassPioneer  -0.05937    0.09690 116.12397
                                             t value Pr(>|t|)    
(Intercept)                                   93.868  < 2e-16 ***
speciesEmpetrum nigrum                         4.762 5.57e-06 ***
speciesVaccinium myrtillus                    15.133  < 2e-16 ***
speciesVaccinium vitis-idaea                   9.213 1.66e-15 ***
ageClassPioneer                               -1.704   0.0909 .  
speciesEmpetrum nigrum:ageClassPioneer         1.108   0.2701    
speciesVaccinium myrtillus:ageClassPioneer     0.513   0.6089    
speciesVaccinium vitis-idaea:ageClassPioneer  -0.613   0.5413    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- agClsP sEn:CP sVm:CP
spcsEmptrmn -0.599                                          
spcsVccnmmy -0.617  0.369                                   
spcsVccvts- -0.709  0.425  0.438                            
ageClassPnr -0.706  0.423  0.435  0.501                     
spcsEngr:CP  0.461 -0.770 -0.284 -0.327 -0.653              
spcsVmyr:CP  0.459 -0.275 -0.744 -0.326 -0.650  0.425       
spcsVvt-:CP  0.479 -0.287 -0.295 -0.675 -0.679  0.443  0.441
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#zero variance


#validate model
performance::check_model(LY_SLA_species_ageClass, detrend = FALSE)

anova(LY_SLA_species_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                  Sum Sq Mean Sq NumDF  DenDF  F value Pr(>F)    
species          10.8150  3.6050     3 118.82 179.5354 <2e-16 ***
ageClass          0.1128  0.1128     1 118.99   5.6163 0.0194 *  
species:ageClass  0.0592  0.0197     3 118.82   0.9835 0.4031    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#xxxxx
LY_SLA_droughtTrt_ageclass <- lmer(log(SLA) ~ DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)
boundary (singular) fit: see help('isSingular')
summary(LY_SLA_droughtTrt_ageclass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(SLA) ~ DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 54

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-5.1284 -0.3052  0.0027  0.3149  5.8896 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.20359  0.4512  
 DroughNet_plotID          (Intercept) 0.00000  0.0000  
 Residual                              0.02017  0.1420  
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                    Estimate Std. Error        df t value
(Intercept)                          4.93140    0.08013 121.49535  61.545
DroughtTrtExt (90)                  -0.20928    0.12192 121.00630  -1.717
ageClassPioneer                     -0.12702    0.11321 121.07661  -1.122
DroughtTrtExt (90):ageClassPioneer   0.15801    0.16571 120.77409   0.954
                                   Pr(>|t|)    
(Intercept)                          <2e-16 ***
DroughtTrtExt (90)                   0.0886 .  
ageClassPioneer                      0.2641    
DroughtTrtExt (90):ageClassPioneer   0.3422    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) DrTE(90) agClsP
DrghtTE(90) -0.657                
ageClassPnr -0.708  0.465         
DrTE(90):CP  0.484 -0.736   -0.683
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#plot variance is zero
#validate model
performance::check_model(LY_SLA_droughtTrt_ageclass, detrend = FALSE)

anova(LY_SLA_droughtTrt_ageclass)
Type III Analysis of Variance Table with Satterthwaite's method
                      Sum Sq  Mean Sq NumDF  DenDF F value Pr(>F)
DroughtTrt          0.049855 0.049855     1 120.77  2.4721 0.1185
ageClass            0.006772 0.006772     1 120.77  0.3358 0.5633
DroughtTrt:ageClass 0.018336 0.018336     1 120.77  0.9092 0.3422
#xxxx
LY_SLA_species__drought_ageClass <- lmer(log(SLA) ~ species * DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)
boundary (singular) fit: see help('isSingular')
summary(LY_SLA_species__drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
log(SLA) ~ species * DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: -135.3

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-5.3224 -0.3563  0.0380  0.3125  5.2279 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.02897  0.1702  
 DroughNet_plotID          (Intercept) 0.00000  0.0000  
 Residual                              0.02008  0.1417  
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                                                 Estimate
(Intercept)                                                       4.37495
speciesEmpetrum nigrum                                            0.28053
speciesVaccinium myrtillus                                        1.21159
speciesVaccinium vitis-idaea                                      0.66040
DroughtTrtExt (90)                                               -0.03462
ageClassPioneer                                                  -0.13859
speciesEmpetrum nigrum:DroughtTrtExt (90)                         0.21141
speciesVaccinium myrtillus:DroughtTrtExt (90)                    -0.32015
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  -0.11489
speciesEmpetrum nigrum:ageClassPioneer                            0.20774
speciesVaccinium myrtillus:ageClassPioneer                       -0.04107
speciesVaccinium vitis-idaea:ageClassPioneer                      0.01246
DroughtTrtExt (90):ageClassPioneer                                0.05336
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        -0.22680
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.36910
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  -0.09914
                                                                Std. Error
(Intercept)                                                        0.06338
speciesEmpetrum nigrum                                             0.10024
speciesVaccinium myrtillus                                         0.09178
speciesVaccinium vitis-idaea                                       0.08942
DroughtTrtExt (90)                                                 0.08976
ageClassPioneer                                                    0.08998
speciesEmpetrum nigrum:DroughtTrtExt (90)                          0.15167
speciesVaccinium myrtillus:DroughtTrtExt (90)                      0.15981
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                    0.12649
speciesEmpetrum nigrum:ageClassPioneer                             0.13339
speciesVaccinium myrtillus:ageClassPioneer                         0.12846
speciesVaccinium vitis-idaea:ageClassPioneer                       0.13859
DroughtTrtExt (90):ageClassPioneer                                 0.12719
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer          0.19609
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer      0.20677
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer    0.18897
                                                                       df
(Intercept)                                                     108.68994
speciesEmpetrum nigrum                                          108.87582
speciesVaccinium myrtillus                                      117.27633
speciesVaccinium vitis-idaea                                    107.72820
DroughtTrtExt (90)                                              109.34299
ageClassPioneer                                                 110.37026
speciesEmpetrum nigrum:DroughtTrtExt (90)                       107.99450
speciesVaccinium myrtillus:DroughtTrtExt (90)                   119.00485
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 107.89423
speciesEmpetrum nigrum:ageClassPioneer                          109.94740
speciesVaccinium myrtillus:ageClassPioneer                      113.65989
speciesVaccinium vitis-idaea:ageClassPioneer                    108.02640
DroughtTrtExt (90):ageClassPioneer                              110.18379
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       109.19600
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   114.78151
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer 108.01506
                                                                t value
(Intercept)                                                      69.025
speciesEmpetrum nigrum                                            2.799
speciesVaccinium myrtillus                                       13.202
speciesVaccinium vitis-idaea                                      7.385
DroughtTrtExt (90)                                               -0.386
ageClassPioneer                                                  -1.540
speciesEmpetrum nigrum:DroughtTrtExt (90)                         1.394
speciesVaccinium myrtillus:DroughtTrtExt (90)                    -2.003
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  -0.908
speciesEmpetrum nigrum:ageClassPioneer                            1.557
speciesVaccinium myrtillus:ageClassPioneer                       -0.320
speciesVaccinium vitis-idaea:ageClassPioneer                      0.090
DroughtTrtExt (90):ageClassPioneer                                0.420
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        -1.157
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     1.785
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  -0.525
                                                                Pr(>|t|)    
(Intercept)                                                      < 2e-16 ***
speciesEmpetrum nigrum                                           0.00607 ** 
speciesVaccinium myrtillus                                       < 2e-16 ***
speciesVaccinium vitis-idaea                                     3.4e-11 ***
DroughtTrtExt (90)                                               0.70046    
ageClassPioneer                                                  0.12639    
speciesEmpetrum nigrum:DroughtTrtExt (90)                        0.16621    
speciesVaccinium myrtillus:DroughtTrtExt (90)                    0.04742 *  
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  0.36572    
speciesEmpetrum nigrum:ageClassPioneer                           0.12226    
speciesVaccinium myrtillus:ageClassPioneer                       0.74977    
speciesVaccinium vitis-idaea:ageClassPioneer                     0.92852    
DroughtTrtExt (90):ageClassPioneer                               0.67564    
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        0.24995    
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer    0.07690 .  
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  0.60089    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation matrix not shown by default, as p = 16 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#plot variance is zero


#validate model
performance::check_model(LY_SLA_species__drought_ageClass, detrend = FALSE)

anova(LY_SLA_species__drought_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                            Sum Sq Mean Sq NumDF  DenDF  F value  Pr(>F)    
species                     9.7819  3.2606     3 110.67 162.3535 < 2e-16 ***
DroughtTrt                  0.0519  0.0519     1 111.08   2.5862 0.11064    
ageClass                    0.0579  0.0579     1 111.08   2.8839 0.09227 .  
species:DroughtTrt          0.1673  0.0558     3 110.67   2.7765 0.04465 *  
species:ageClass            0.0754  0.0251     3 110.67   1.2516 0.29464    
DroughtTrt:ageClass         0.0156  0.0156     1 111.08   0.7786 0.37947    
species:DroughtTrt:ageClass 0.1592  0.0531     3 110.67   2.6428 0.05284 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Trait 3: plant height

#species * DroughtTrt
LY_height_species_droughtTrt <- lmer(plant_height ~ species * DroughtTrt +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)

summary(LY_height_species_droughtTrt)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: plant_height ~ species * DroughtTrt + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 594.7

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-13.0089  -0.0042   0.0000   0.0040   4.3381 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 29.19625 5.4034  
 DroughNet_plotID          (Intercept)  6.97503 2.6410  
 Residual                               0.01608 0.1268  
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                                Estimate Std. Error       df
(Intercept)                                      27.3805     1.6688  27.7952
speciesEmpetrum nigrum                           -9.7855     1.8826 109.8019
speciesVaccinium myrtillus                      -14.5863     1.8013 107.3982
speciesVaccinium vitis-idaea                    -16.0806     1.9400 108.6385
DroughtTrtExt (90)                                3.0889     2.3600  27.7952
speciesEmpetrum nigrum:DroughtTrtExt (90)         0.5959     2.7296 111.1743
speciesVaccinium myrtillus:DroughtTrtExt (90)     2.0112     2.8422 111.0268
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   1.4725     2.6663 108.1213
                                                t value Pr(>|t|)    
(Intercept)                                      16.407 7.91e-16 ***
speciesEmpetrum nigrum                           -5.198 9.40e-07 ***
speciesVaccinium myrtillus                       -8.098 9.46e-13 ***
speciesVaccinium vitis-idaea                     -8.289 3.33e-13 ***
DroughtTrtExt (90)                                1.309    0.201    
speciesEmpetrum nigrum:DroughtTrtExt (90)         0.218    0.828    
speciesVaccinium myrtillus:DroughtTrtExt (90)     0.708    0.481    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   0.552    0.582    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.516                                          
spcsVccnmmy -0.540  0.478                                   
spcsVccvts- -0.501  0.435  0.464                            
DrghtTE(90) -0.707  0.365  0.382  0.354                     
sEn:DTE(90)  0.356 -0.690 -0.330 -0.300 -0.504              
sVm:DTE(90)  0.342 -0.303 -0.634 -0.294 -0.484  0.446       
sVv-:DTE(90  0.365 -0.316 -0.338 -0.728 -0.516  0.438  0.426
#validate model
performance::check_model(LY_height_species_droughtTrt , detrend = FALSE)

anova(LY_height_species_droughtTrt)
Type III Analysis of Variance Table with Satterthwaite's method
                    Sum Sq Mean Sq NumDF   DenDF F value  Pr(>F)    
species            2.56118 0.85373     3 110.500 53.0792 < 2e-16 ***
DroughtTrt         0.08101 0.08101     1  10.368  5.0367 0.04775 *  
species:DroughtTrt 0.00996 0.00332     3 110.500  0.2064 0.89177    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# species * age Class (h2)

LY_height_species_ageClass <- lmer(plant_height ~ species * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)

summary(LY_height_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: plant_height ~ species * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 593.1

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-13.0108  -0.0049  -0.0003   0.0042   4.3362 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 28.62976 5.3507  
 DroughNet_plotID          (Intercept)  7.54963 2.7477  
 Residual                               0.01608 0.1268  
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                             Estimate Std. Error      df
(Intercept)                                    31.692      1.688  25.289
speciesEmpetrum nigrum                        -10.149      2.183 112.355
speciesVaccinium myrtillus                    -14.987      2.051 112.134
speciesVaccinium vitis-idaea                  -17.608      1.784 106.862
ageClassPioneer                                -5.533      2.387  25.289
speciesEmpetrum nigrum:ageClassPioneer          1.705      2.796 110.643
speciesVaccinium myrtillus:ageClassPioneer      2.256      2.760 110.256
speciesVaccinium vitis-idaea:ageClassPioneer    5.038      2.652 107.539
                                             t value Pr(>|t|)    
(Intercept)                                   18.775 2.30e-16 ***
speciesEmpetrum nigrum                        -4.648 9.18e-06 ***
speciesVaccinium myrtillus                    -7.308 4.27e-11 ***
speciesVaccinium vitis-idaea                  -9.872  < 2e-16 ***
ageClassPioneer                               -2.318   0.0288 *  
speciesEmpetrum nigrum:ageClassPioneer         0.610   0.5433    
speciesVaccinium myrtillus:ageClassPioneer     0.818   0.4153    
speciesVaccinium vitis-idaea:ageClassPioneer   1.900   0.0602 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- agClsP sEn:CP sVm:CP
spcsEmptrmn -0.432                                          
spcsVccnmmy -0.460  0.391                                   
spcsVccvts- -0.528  0.408  0.435                            
ageClassPnr -0.707  0.305  0.325  0.374                     
spcsEngr:CP  0.337 -0.781 -0.305 -0.319 -0.477              
spcsVmyr:CP  0.342 -0.290 -0.743 -0.323 -0.483  0.435       
spcsVvt-:CP  0.355 -0.275 -0.292 -0.673 -0.503  0.427  0.432
#validate model
performance::check_model(LY_height_species_ageClass, detrend = FALSE)

anova(LY_height_species_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                  Sum Sq Mean Sq NumDF   DenDF F value Pr(>F)    
species          2.60338 0.86779     3 109.880 53.9537 <2e-16 ***
ageClass         0.04898 0.04898     1   9.945  3.0454 0.1117    
species:ageClass 0.05890 0.01963     3 109.880  1.2207 0.3057    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#xxxx
LY_height_droughtTrt_ageclass <- lmer(plant_height ~ DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)
Warning: Model failed to converge with 1 negative eigenvalue: -2.3e-01
summary(LY_height_droughtTrt_ageclass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: plant_height ~ DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 704.2

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-13.0055  -0.0038  -0.0016   0.0037   4.3415 

Random effects:
 Groups                    Name        Variance  Std.Dev. 
 plant_nr:DroughNet_plotID (Intercept) 6.945e+01 8.333e+00
 DroughNet_plotID          (Intercept) 8.603e-09 9.275e-05
 Residual                              1.608e-02 1.268e-01
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                   Estimate Std. Error      df t value Pr(>|t|)
(Intercept)                          18.599      1.451 121.002  12.820  < 2e-16
DroughtTrtExt (90)                    6.229      2.210 121.001   2.819  0.00563
ageClassPioneer                      -1.656      2.052 121.001  -0.807  0.42112
DroughtTrtExt (90):ageClassPioneer   -3.803      3.005 121.001  -1.265  0.20814
                                      
(Intercept)                        ***
DroughtTrtExt (90)                 ** 
ageClassPioneer                       
DroughtTrtExt (90):ageClassPioneer    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) DrTE(90) agClsP
DrghtTE(90) -0.657                
ageClassPnr -0.707  0.464         
DrTE(90):CP  0.483 -0.735   -0.683
# failed to converge
#validate model
performance::check_model(LY_height_droughtTrt_ageclass, detrend = FALSE)

anova(LY_height_droughtTrt_ageclass)
Type III Analysis of Variance Table with Satterthwaite's method
                      Sum Sq  Mean Sq NumDF DenDF F value   Pr(>F)   
DroughtTrt          0.133464 0.133464     1   121  8.2979 0.004696 **
ageClass            0.090170 0.090170     1   121  5.6061 0.019483 * 
DroughtTrt:ageClass 0.025757 0.025757     1   121  1.6014 0.208136   
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LY_height_species__drought_ageClass <- lmer(plant_height ~ species * DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)

summary(LY_height_species__drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
plant_height ~ species * DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: 549.3

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-13.0094  -0.0039  -0.0007   0.0040   4.3376 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 29.02626 5.3876  
 DroughNet_plotID          (Intercept)  4.08609 2.0214  
 Residual                               0.01608 0.1268  
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                                                 Estimate
(Intercept)                                                      28.61662
speciesEmpetrum nigrum                                           -9.69570
speciesVaccinium myrtillus                                      -14.51691
speciesVaccinium vitis-idaea                                    -16.12777
DroughtTrtExt (90)                                                6.14994
ageClassPioneer                                                  -2.47219
speciesEmpetrum nigrum:DroughtTrtExt (90)                        -0.01530
speciesVaccinium myrtillus:DroughtTrtExt (90)                     1.33645
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  -2.96102
speciesEmpetrum nigrum:ageClassPioneer                            0.08373
speciesVaccinium myrtillus:ageClassPioneer                       -0.13866
speciesVaccinium vitis-idaea:ageClassPioneer                      0.02371
DroughtTrtExt (90):ageClassPioneer                               -6.12216
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         2.28957
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     2.69825
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   9.21376
                                                                Std. Error
(Intercept)                                                        2.14192
speciesEmpetrum nigrum                                             2.90703
speciesVaccinium myrtillus                                         2.54007
speciesVaccinium vitis-idaea                                       2.53999
DroughtTrtExt (90)                                                 3.02913
ageClassPioneer                                                    3.02914
speciesEmpetrum nigrum:DroughtTrtExt (90)                          4.42179
speciesVaccinium myrtillus:DroughtTrtExt (90)                      4.55184
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                    3.59208
speciesEmpetrum nigrum:ageClassPioneer                             3.81979
speciesVaccinium myrtillus:ageClassPioneer                         3.59215
speciesVaccinium vitis-idaea:ageClassPioneer                       3.95667
DroughtTrtExt (90):ageClassPioneer                                 4.28385
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer          5.64781
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer      5.88551
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer    5.38310
                                                                       df
(Intercept)                                                      29.04023
speciesEmpetrum nigrum                                          106.75727
speciesVaccinium myrtillus                                      101.50114
speciesVaccinium vitis-idaea                                    101.48812
DroughtTrtExt (90)                                               29.04037
ageClassPioneer                                                  29.04056
speciesEmpetrum nigrum:DroughtTrtExt (90)                       107.68929
speciesVaccinium myrtillus:DroughtTrtExt (90)                   108.65764
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 101.48797
speciesEmpetrum nigrum:ageClassPioneer                          104.94878
speciesVaccinium myrtillus:ageClassPioneer                      101.49549
speciesVaccinium vitis-idaea:ageClassPioneer                    102.87532
DroughtTrtExt (90):ageClassPioneer                               29.04051
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       106.08734
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   107.02967
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer 102.32045
                                                                t value
(Intercept)                                                      13.360
speciesEmpetrum nigrum                                           -3.335
speciesVaccinium myrtillus                                       -5.715
speciesVaccinium vitis-idaea                                     -6.350
DroughtTrtExt (90)                                                2.030
ageClassPioneer                                                  -0.816
speciesEmpetrum nigrum:DroughtTrtExt (90)                        -0.003
speciesVaccinium myrtillus:DroughtTrtExt (90)                     0.294
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  -0.824
speciesEmpetrum nigrum:ageClassPioneer                            0.022
speciesVaccinium myrtillus:ageClassPioneer                       -0.039
speciesVaccinium vitis-idaea:ageClassPioneer                      0.006
DroughtTrtExt (90):ageClassPioneer                               -1.429
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         0.405
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.458
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   1.712
                                                                Pr(>|t|)    
(Intercept)                                                     6.25e-14 ***
speciesEmpetrum nigrum                                           0.00117 ** 
speciesVaccinium myrtillus                                      1.10e-07 ***
speciesVaccinium vitis-idaea                                    6.15e-09 ***
DroughtTrtExt (90)                                               0.05158 .  
ageClassPioneer                                                  0.42107    
speciesEmpetrum nigrum:DroughtTrtExt (90)                        0.99725    
speciesVaccinium myrtillus:DroughtTrtExt (90)                    0.76962    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  0.41169    
speciesEmpetrum nigrum:ageClassPioneer                           0.98255    
speciesVaccinium myrtillus:ageClassPioneer                       0.96929    
speciesVaccinium vitis-idaea:ageClassPioneer                     0.99523    
DroughtTrtExt (90):ageClassPioneer                               0.16364    
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        0.68601    
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer    0.64755    
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  0.09000 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation matrix not shown by default, as p = 16 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it
#validate model
performance::check_model(LY_height_species__drought_ageClass, detrend = FALSE)

anova(LY_height_species__drought_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                             Sum Sq Mean Sq NumDF   DenDF F value  Pr(>F)    
species                     2.44934 0.81645     3 105.515 50.7614 < 2e-16 ***
DroughtTrt                  0.12877 0.12877     1   8.707  8.0060 0.02038 *  
ageClass                    0.09205 0.09205     1   8.707  5.7230 0.04129 *  
species:DroughtTrt          0.01457 0.00486     3 105.515  0.3019 0.82393    
species:ageClass            0.05013 0.01671     3 105.515  1.0390 0.37853    
DroughtTrt:ageClass         0.01073 0.01073     1   8.707  0.6673 0.43579    
species:DroughtTrt:ageClass 0.04953 0.01651     3 105.515  1.0265 0.38402    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Trait 4: mean -thickness

#species * DroughtTrt
#xxxx
LY_thickness_species_droughtTrt <- lmer(mean_thickness ~ species * DroughtTrt +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)
boundary (singular) fit: see help('isSingular')
summary(LY_thickness_species_droughtTrt)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
mean_thickness ~ species * DroughtTrt + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: -1009.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.0080 -0.4260 -0.1063  0.2870  4.6948 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.001526 0.03906 
 DroughNet_plotID          (Intercept) 0.000000 0.00000 
 Residual                              0.001899 0.04357 
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                                  Estimate Std. Error
(Intercept)                                       0.322832   0.011125
speciesEmpetrum nigrum                           -0.111643   0.016218
speciesVaccinium myrtillus                       -0.195892   0.015923
speciesVaccinium vitis-idaea                     -0.050693   0.016688
DroughtTrtExt (90)                                0.002070   0.015723
speciesEmpetrum nigrum:DroughtTrtExt (90)        -0.013053   0.023345
speciesVaccinium myrtillus:DroughtTrtExt (90)     0.007437   0.024518
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   0.017471   0.022998
                                                        df t value Pr(>|t|)    
(Intercept)                                     116.473594  29.017  < 2e-16 ***
speciesEmpetrum nigrum                          115.860236  -6.884 3.18e-10 ***
speciesVaccinium myrtillus                      120.014943 -12.303  < 2e-16 ***
speciesVaccinium vitis-idaea                    113.178900  -3.038  0.00296 ** 
DroughtTrtExt (90)                              116.285862   0.132  0.89550    
speciesEmpetrum nigrum:DroughtTrtExt (90)       115.918266  -0.559  0.57713    
speciesVaccinium myrtillus:DroughtTrtExt (90)   117.612027   0.303  0.76217    
speciesVaccinium vitis-idaea:DroughtTrtExt (90) 113.123847   0.760  0.44902    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.686                                          
spcsVccnmmy -0.699  0.479                                   
spcsVccvts- -0.667  0.457  0.466                            
DrghtTE(90) -0.708  0.485  0.494  0.472                     
sEn:DTE(90)  0.477 -0.695 -0.333 -0.318 -0.674              
sVm:DTE(90)  0.454 -0.311 -0.649 -0.303 -0.641  0.432       
sVv-:DTE(90  0.484 -0.332 -0.338 -0.726 -0.684  0.460  0.438
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#plot variance is zero
#validate model
performance::check_model(LY_thickness_species_droughtTrt , detrend = FALSE)

# species * age Class xxx

LY_thickness_species_ageClass <- lmer(mean_thickness ~ species * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)
boundary (singular) fit: see help('isSingular')
summary(LY_thickness_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: mean_thickness ~ species * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: -1017.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.0105 -0.4426 -0.1150  0.3268  4.7987 

Random effects:
 Groups                    Name        Variance  Std.Dev. 
 plant_nr:DroughNet_plotID (Intercept) 1.389e-03 3.727e-02
 DroughNet_plotID          (Intercept) 6.485e-12 2.547e-06
 Residual                              1.895e-03 4.353e-02
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                              Estimate Std. Error        df
(Intercept)                                    0.30185    0.01073 115.70735
speciesEmpetrum nigrum                        -0.08758    0.01789 114.27107
speciesVaccinium myrtillus                    -0.16318    0.01763 128.68573
speciesVaccinium vitis-idaea                  -0.01256    0.01509 113.39572
ageClassPioneer                                0.04427    0.01522 117.18626
speciesEmpetrum nigrum:ageClassPioneer        -0.05671    0.02328 115.90141
speciesVaccinium myrtillus:ageClassPioneer    -0.05800    0.02355 122.60936
speciesVaccinium vitis-idaea:ageClassPioneer  -0.05953    0.02236 113.76680
                                             t value Pr(>|t|)    
(Intercept)                                   28.128  < 2e-16 ***
speciesEmpetrum nigrum                        -4.896 3.24e-06 ***
speciesVaccinium myrtillus                    -9.256 6.06e-16 ***
speciesVaccinium vitis-idaea                  -0.832  0.40705    
ageClassPioneer                                2.908  0.00435 ** 
speciesEmpetrum nigrum:ageClassPioneer        -2.436  0.01636 *  
speciesVaccinium myrtillus:ageClassPioneer    -2.462  0.01519 *  
speciesVaccinium vitis-idaea:ageClassPioneer  -2.663  0.00887 ** 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- agClsP sEn:CP sVm:CP
spcsEmptrmn -0.600                                          
spcsVccnmmy -0.609  0.365                                   
spcsVccvts- -0.711  0.427  0.433                            
ageClassPnr -0.705  0.423  0.429  0.501                     
spcsEngr:CP  0.461 -0.769 -0.281 -0.328 -0.654              
spcsVmyr:CP  0.456 -0.273 -0.748 -0.324 -0.646  0.423       
spcsVvt-:CP  0.480 -0.288 -0.292 -0.675 -0.681  0.445  0.440
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#validate model
performance::check_model(LY_thickness_species_ageClass, detrend = FALSE)

#xxxx
LY_thickness_droughtTrt_ageclass <- lmer(mean_thickness ~ DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)
boundary (singular) fit: see help('isSingular')
summary(LY_thickness_droughtTrt_ageclass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
mean_thickness ~ DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: -882.7

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.1312 -0.3744 -0.0822  0.2949  4.1448 

Random effects:
 Groups                    Name        Variance  Std.Dev. 
 plant_nr:DroughNet_plotID (Intercept) 6.839e-03 8.270e-02
 DroughNet_plotID          (Intercept) 4.282e-12 2.069e-06
 Residual                              1.901e-03 4.360e-02
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                    Estimate Std. Error        df t value
(Intercept)                          0.23661    0.01519 122.10947  15.581
DroughtTrtExt (90)                   0.03075    0.02307 120.99573   1.333
ageClassPioneer                     -0.00768    0.02143 121.18083  -0.358
DroughtTrtExt (90):ageClassPioneer  -0.01550    0.03134 120.50134  -0.495
                                   Pr(>|t|)    
(Intercept)                          <2e-16 ***
DroughtTrtExt (90)                    0.185    
ageClassPioneer                       0.721    
DroughtTrtExt (90):ageClassPioneer    0.622    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) DrTE(90) agClsP
DrghtTE(90) -0.658                
ageClassPnr -0.709  0.466         
DrTE(90):CP  0.485 -0.736   -0.684
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#plot and plant nr variance is 0
#validate model
performance::check_model(LY_thickness_droughtTrt_ageclass, detrend = FALSE)

anova(LY_thickness_droughtTrt_ageclass)
Type III Analysis of Variance Table with Satterthwaite's method
                       Sum Sq   Mean Sq NumDF DenDF F value Pr(>F)
DroughtTrt          0.0040959 0.0040959     1 120.5  2.1548 0.1447
ageClass            0.0018432 0.0018432     1 120.5  0.9697 0.3267
DroughtTrt:ageClass 0.0004649 0.0004649     1 120.5  0.2446 0.6218

three way interactions

LY_thickness_species__drought_ageClass <- lmer(mean_thickness ~ species * DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = lygra_data)

summary(LY_thickness_species__drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
mean_thickness ~ species * DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: lygra_data

REML criterion at convergence: -981.8

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.7738 -0.4397 -0.0997  0.2743  4.8553 

Random effects:
 Groups                    Name        Variance  Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1.331e-03 0.036484
 DroughNet_plotID          (Intercept) 3.549e-05 0.005958
 Residual                              1.897e-03 0.043552
Number of obs: 351, groups:  
plant_nr:DroughNet_plotID, 125; DroughNet_plotID, 12

Fixed effects:
                                                                  Estimate
(Intercept)                                                       0.289742
speciesEmpetrum nigrum                                           -0.057225
speciesVaccinium myrtillus                                       -0.159014
speciesVaccinium vitis-idaea                                     -0.001567
DroughtTrtExt (90)                                                0.024389
ageClassPioneer                                                   0.066886
speciesEmpetrum nigrum:DroughtTrtExt (90)                        -0.068441
speciesVaccinium myrtillus:DroughtTrtExt (90)                     0.007478
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  -0.022169
speciesEmpetrum nigrum:ageClassPioneer                           -0.101336
speciesVaccinium myrtillus:ageClassPioneer                       -0.074174
speciesVaccinium vitis-idaea:ageClassPioneer                     -0.111327
DroughtTrtExt (90):ageClassPioneer                               -0.045348
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         0.096027
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.016471
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   0.092841
                                                                Std. Error
(Intercept)                                                       0.015319
speciesEmpetrum nigrum                                            0.023773
speciesVaccinium myrtillus                                        0.021870
speciesVaccinium vitis-idaea                                      0.021030
DroughtTrtExt (90)                                                0.021717
ageClassPioneer                                                   0.021800
speciesEmpetrum nigrum:DroughtTrtExt (90)                         0.035926
speciesVaccinium myrtillus:DroughtTrtExt (90)                     0.038438
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   0.029757
speciesEmpetrum nigrum:ageClassPioneer                            0.031600
speciesVaccinium myrtillus:ageClassPioneer                        0.030473
speciesVaccinium vitis-idaea:ageClassPioneer                      0.032662
DroughtTrtExt (90):ageClassPioneer                                0.030807
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         0.046426
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.049345
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   0.044508
                                                                        df
(Intercept)                                                      54.999734
speciesEmpetrum nigrum                                          106.802382
speciesVaccinium myrtillus                                      108.682853
speciesVaccinium vitis-idaea                                     96.755602
DroughtTrtExt (90)                                               55.545534
ageClassPioneer                                                  56.391647
speciesEmpetrum nigrum:DroughtTrtExt (90)                       105.516642
speciesVaccinium myrtillus:DroughtTrtExt (90)                   118.818059
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  97.184865
speciesEmpetrum nigrum:ageClassPioneer                          106.612954
speciesVaccinium myrtillus:ageClassPioneer                      104.584944
speciesVaccinium vitis-idaea:ageClassPioneer                    100.346010
DroughtTrtExt (90):ageClassPioneer                               56.243524
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       106.193275
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   113.502704
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  99.308416
                                                                t value
(Intercept)                                                      18.913
speciesEmpetrum nigrum                                           -2.407
speciesVaccinium myrtillus                                       -7.271
speciesVaccinium vitis-idaea                                     -0.075
DroughtTrtExt (90)                                                1.123
ageClassPioneer                                                   3.068
speciesEmpetrum nigrum:DroughtTrtExt (90)                        -1.905
speciesVaccinium myrtillus:DroughtTrtExt (90)                     0.195
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  -0.745
speciesEmpetrum nigrum:ageClassPioneer                           -3.207
speciesVaccinium myrtillus:ageClassPioneer                       -2.434
speciesVaccinium vitis-idaea:ageClassPioneer                     -3.408
DroughtTrtExt (90):ageClassPioneer                               -1.472
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         2.068
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.334
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   2.086
                                                                Pr(>|t|)    
(Intercept)                                                      < 2e-16 ***
speciesEmpetrum nigrum                                          0.017792 *  
speciesVaccinium myrtillus                                       5.8e-11 ***
speciesVaccinium vitis-idaea                                    0.940750    
DroughtTrtExt (90)                                              0.266248    
ageClassPioneer                                                 0.003307 ** 
speciesEmpetrum nigrum:DroughtTrtExt (90)                       0.059495 .  
speciesVaccinium myrtillus:DroughtTrtExt (90)                   0.846090    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 0.458074    
speciesEmpetrum nigrum:ageClassPioneer                          0.001772 ** 
speciesVaccinium myrtillus:ageClassPioneer                      0.016623 *  
speciesVaccinium vitis-idaea:ageClassPioneer                    0.000942 ***
DroughtTrtExt (90):ageClassPioneer                              0.146597    
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       0.041033 *  
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   0.739152    
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer 0.039548 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation matrix not shown by default, as p = 16 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it
#the model is okak, but very small variability

#validate model
performance::check_model(LY_thickness_species__drought_ageClass, detrend = FALSE)

anova(LY_thickness_species__drought_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                             Sum Sq  Mean Sq NumDF   DenDF F value  Pr(>F)    
species                     0.51079 0.170263     3 106.780 89.7639 < 2e-16 ***
DroughtTrt                  0.00095 0.000953     1   8.598  0.5023 0.49727    
ageClass                    0.00007 0.000073     1   8.598  0.0386 0.84873    
species:DroughtTrt          0.00732 0.002441     3 106.780  1.2868 0.28275    
species:ageClass            0.02211 0.007371     3 106.780  3.8863 0.01111 *  
DroughtTrt:ageClass         0.00020 0.000196     1   8.598  0.1033 0.75553    
species:DroughtTrt:ageClass 0.01313 0.004377     3 106.780  2.3076 0.08070 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

site: Tjøtta

# Filter the data for siteID tjøtta
tjøtta_data <- filtered_data %>%
  filter(siteID == "Tjøtta")
view(tjøtta_data)

trait 1- LDMC

tj_LDMC_species_ageClass <- lmer(LDMC ~ species * DroughtTrt +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)

summary(tj_LDMC_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: LDMC ~ species * DroughtTrt + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: 4199.9

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.9781 -0.4023  0.0453  0.3695  7.3402 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1232.0   35.10   
 DroughNet_plotID          (Intercept)  502.8   22.42   
 Residual                               983.4   31.36   
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                                Estimate Std. Error       df
(Intercept)                                     365.3070    13.0952  24.7413
speciesEmpetrum nigrum                            2.8288    13.2038 121.4967
speciesVaccinium myrtillus                        0.9582    13.9743 122.2320
speciesVaccinium vitis-idaea                     -2.9773    13.2038 121.4967
DroughtTrtExt (90)                               -6.7206    18.4172  24.2434
speciesEmpetrum nigrum:DroughtTrtExt (90)        -8.6540    18.5715 121.9769
speciesVaccinium myrtillus:DroughtTrtExt (90)     1.5045    19.6772 123.1415
speciesVaccinium vitis-idaea:DroughtTrtExt (90)  20.0354    18.5715 121.9769
                                                t value Pr(>|t|)    
(Intercept)                                      27.896   <2e-16 ***
speciesEmpetrum nigrum                            0.214    0.831    
speciesVaccinium myrtillus                        0.069    0.945    
speciesVaccinium vitis-idaea                     -0.225    0.822    
DroughtTrtExt (90)                               -0.365    0.718    
speciesEmpetrum nigrum:DroughtTrtExt (90)        -0.466    0.642    
speciesVaccinium myrtillus:DroughtTrtExt (90)     0.076    0.939    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   1.079    0.283    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.507                                          
spcsVccnmmy -0.477  0.473                                   
spcsVccvts- -0.507  0.503  0.473                            
DrghtTE(90) -0.711  0.361  0.339  0.361                     
sEn:DTE(90)  0.361 -0.711 -0.336 -0.358 -0.502              
sVm:DTE(90)  0.339 -0.336 -0.710 -0.336 -0.472  0.468       
sVv-:DTE(90  0.361 -0.358 -0.336 -0.711 -0.502  0.498  0.468
performance::check_model(tj_LDMC_species_ageClass, detrend = FALSE)

# species * age Class (h2)

tj_LDMC_species_ageClass <- lmer(LDMC ~ species * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)

summary(tj_LDMC_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: LDMC ~ species * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: 4193.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.8531 -0.4241  0.0390  0.3994  7.3356 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1195.6   34.58   
 DroughNet_plotID          (Intercept)  311.9   17.66   
 Residual                               983.8   31.37   
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                             Estimate Std. Error      df
(Intercept)                                   342.697     11.574  28.627
speciesEmpetrum nigrum                         19.150     12.908 121.768
speciesVaccinium myrtillus                      5.399     12.908 121.768
speciesVaccinium vitis-idaea                   15.694     12.908 121.768
ageClassPioneer                                38.943     16.480  29.333
speciesEmpetrum nigrum:ageClassPioneer        -41.741     18.355 121.247
speciesVaccinium myrtillus:ageClassPioneer     -2.210     19.690 123.491
speciesVaccinium vitis-idaea:ageClassPioneer  -17.751     18.355 121.247
                                             t value Pr(>|t|)    
(Intercept)                                   29.609   <2e-16 ***
speciesEmpetrum nigrum                         1.484   0.1405    
speciesVaccinium myrtillus                     0.418   0.6765    
speciesVaccinium vitis-idaea                   1.216   0.2264    
ageClassPioneer                                2.363   0.0250 *  
speciesEmpetrum nigrum:ageClassPioneer        -2.274   0.0247 *  
speciesVaccinium myrtillus:ageClassPioneer    -0.112   0.9108    
speciesVaccinium vitis-idaea:ageClassPioneer  -0.967   0.3354    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- agClsP sEn:CP sVm:CP
spcsEmptrmn -0.549                                          
spcsVccnmmy -0.549  0.492                                   
spcsVccvts- -0.549  0.492  0.492                            
ageClassPnr -0.702  0.385  0.385  0.385                     
spcsEngr:CP  0.386 -0.703 -0.346 -0.346 -0.554              
spcsVmyr:CP  0.360 -0.323 -0.656 -0.323 -0.515  0.463       
spcsVvt-:CP  0.386 -0.346 -0.346 -0.703 -0.554  0.498  0.463
#validate model
performance::check_model(tj_LDMC_species_ageClass, detrend = FALSE)

tj_LDMC_drought_ageClass <- lmer(LDMC ~ DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)

summary(tj_LDMC_drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: LDMC ~ DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: 4222.4

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.9346 -0.4073  0.0229  0.4122  7.3676 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1204.8   34.71   
 DroughNet_plotID          (Intercept)  233.6   15.28   
 Residual                               983.5   31.36   
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                   Estimate Std. Error      df t value Pr(>|t|)
(Intercept)                         366.448     10.974   6.928  33.393 6.51e-09
DroughtTrtExt (90)                  -27.479     15.497   6.888  -1.773   0.1202
ageClassPioneer                      -1.344     15.674   7.185  -0.086   0.9340
DroughtTrtExt (90):ageClassPioneer   48.327     22.141   7.154   2.183   0.0646
                                      
(Intercept)                        ***
DroughtTrtExt (90)                    
ageClassPioneer                       
DroughtTrtExt (90):ageClassPioneer .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) DrTE(90) agClsP
DrghtTE(90) -0.708                
ageClassPnr -0.700  0.496         
DrTE(90):CP  0.496 -0.700   -0.708
#validate model
performance::check_model(tj_LDMC_drought_ageClass, detrend = FALSE)

three way

tj_LDMC_species__drought_ageClass <- lmer(LDMC ~ species * DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)

summary(tj_LDMC_species__drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
LDMC ~ species * DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: 4119.4

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.9102 -0.3959  0.0316  0.3868  7.3235 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 1200.2   34.64   
 DroughNet_plotID          (Intercept)  196.4   14.01   
 Residual                               984.2   31.37   
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                                                Estimate
(Intercept)                                                     365.0042
speciesEmpetrum nigrum                                            7.8667
speciesVaccinium myrtillus                                       -0.2394
speciesVaccinium vitis-idaea                                     -1.8511
DroughtTrtExt (90)                                              -43.8453
ageClassPioneer                                                   0.9506
speciesEmpetrum nigrum:DroughtTrtExt (90)                        21.7984
speciesVaccinium myrtillus:DroughtTrtExt (90)                    10.5093
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  34.3212
speciesEmpetrum nigrum:ageClassPioneer                          -10.4209
speciesVaccinium myrtillus:ageClassPioneer                        7.4993
speciesVaccinium vitis-idaea:ageClassPioneer                     -2.5974
DroughtTrtExt (90):ageClassPioneer                               75.1340
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       -61.7894
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   -15.5226
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer -29.4562
                                                                Std. Error
(Intercept)                                                        15.3381
speciesEmpetrum nigrum                                             18.4283
speciesVaccinium myrtillus                                         18.4283
speciesVaccinium vitis-idaea                                       18.4283
DroughtTrtExt (90)                                                 21.4489
ageClassPioneer                                                    21.7853
speciesEmpetrum nigrum:DroughtTrtExt (90)                          25.8602
speciesVaccinium myrtillus:DroughtTrtExt (90)                      25.8602
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                    25.8602
speciesEmpetrum nigrum:ageClassPioneer                             26.1399
speciesVaccinium myrtillus:ageClassPioneer                         27.9486
speciesVaccinium vitis-idaea:ageClassPioneer                       26.1399
DroughtTrtExt (90):ageClassPioneer                                 30.5722
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer          36.7702
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer      39.3694
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer    36.7702
                                                                      df
(Intercept)                                                      28.8418
speciesEmpetrum nigrum                                          113.2914
speciesVaccinium myrtillus                                      113.2914
speciesVaccinium vitis-idaea                                    113.2914
DroughtTrtExt (90)                                               27.7439
ageClassPioneer                                                  29.3007
speciesEmpetrum nigrum:DroughtTrtExt (90)                       114.9675
speciesVaccinium myrtillus:DroughtTrtExt (90)                   114.9675
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 114.9675
speciesEmpetrum nigrum:ageClassPioneer                          114.0809
speciesVaccinium myrtillus:ageClassPioneer                      116.6766
speciesVaccinium vitis-idaea:ageClassPioneer                    114.0809
DroughtTrtExt (90):ageClassPioneer                               28.5208
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       114.5183
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   117.5893
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer 114.5183
                                                                t value
(Intercept)                                                      23.797
speciesEmpetrum nigrum                                            0.427
speciesVaccinium myrtillus                                       -0.013
speciesVaccinium vitis-idaea                                     -0.100
DroughtTrtExt (90)                                               -2.044
ageClassPioneer                                                   0.044
speciesEmpetrum nigrum:DroughtTrtExt (90)                         0.843
speciesVaccinium myrtillus:DroughtTrtExt (90)                     0.406
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   1.327
speciesEmpetrum nigrum:ageClassPioneer                           -0.399
speciesVaccinium myrtillus:ageClassPioneer                        0.268
speciesVaccinium vitis-idaea:ageClassPioneer                     -0.099
DroughtTrtExt (90):ageClassPioneer                                2.458
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        -1.680
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer    -0.394
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  -0.801
                                                                Pr(>|t|)    
(Intercept)                                                       <2e-16 ***
speciesEmpetrum nigrum                                            0.6703    
speciesVaccinium myrtillus                                        0.9897    
speciesVaccinium vitis-idaea                                      0.9202    
DroughtTrtExt (90)                                                0.0505 .  
ageClassPioneer                                                   0.9655    
speciesEmpetrum nigrum:DroughtTrtExt (90)                         0.4010    
speciesVaccinium myrtillus:DroughtTrtExt (90)                     0.6852    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   0.1871    
speciesEmpetrum nigrum:ageClassPioneer                            0.6909    
speciesVaccinium myrtillus:ageClassPioneer                        0.7889    
speciesVaccinium vitis-idaea:ageClassPioneer                      0.9210    
DroughtTrtExt (90):ageClassPioneer                                0.0203 *  
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         0.0956 .  
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.6941    
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   0.4247    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation matrix not shown by default, as p = 16 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it
#validate model
performance::check_model(tj_LDMC_species__drought_ageClass, detrend = FALSE)

anova(tj_LDMC_species__drought_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                            Sum Sq Mean Sq NumDF   DenDF F value  Pr(>F)  
species                     1089.0   363.0     3 115.518  0.3688 0.77563  
DroughtTrt                    78.1    78.1     1   6.708  0.0793 0.78670  
ageClass                    5020.1  5020.1     1   6.708  5.1007 0.06008 .
species:DroughtTrt          2494.4   831.5     3 115.518  0.8448 0.47208  
species:ageClass            6323.1  2107.7     3 115.518  2.1416 0.09879 .
DroughtTrt:ageClass         5202.8  5202.8     1   6.708  5.2864 0.05664 .
species:DroughtTrt:ageClass 2974.4   991.5     3 115.518  1.0074 0.39221  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Trait- plant height

tj_height_species_drought <- lmer(log(plant_height) ~ species * DroughtTrt +
                                    (1 | DroughNet_plotID), 
                                  data = tjøtta_data)

summary(tj_height_species_drought)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(plant_height) ~ species * DroughtTrt + (1 | DroughNet_plotID)
   Data: tjøtta_data

REML criterion at convergence: 87.2

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.65889 -0.67624 -0.00726  0.66075  2.11680 

Random effects:
 Groups           Name        Variance Std.Dev.
 DroughNet_plotID (Intercept) 0.08434  0.2904  
 Residual                     0.06104  0.2471  
Number of obs: 414, groups:  DroughNet_plotID, 12

Fixed effects:
                                                 Estimate Std. Error        df
(Intercept)                                       2.79580    0.12326  11.21812
speciesEmpetrum nigrum                           -0.16760    0.04761 396.07156
speciesVaccinium myrtillus                       -0.47171    0.05036 396.44916
speciesVaccinium vitis-idaea                     -0.51820    0.04761 396.07156
DroughtTrtExt (90)                                0.06054    0.17430  11.21412
speciesEmpetrum nigrum:DroughtTrtExt (90)        -0.01080    0.06729 396.04696
speciesVaccinium myrtillus:DroughtTrtExt (90)     0.12624    0.07139 396.53414
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   0.13613    0.06729 396.04696
                                                t value Pr(>|t|)    
(Intercept)                                      22.682 9.99e-11 ***
speciesEmpetrum nigrum                           -3.521 0.000481 ***
speciesVaccinium myrtillus                       -9.367  < 2e-16 ***
speciesVaccinium vitis-idaea                    -10.885  < 2e-16 ***
DroughtTrtExt (90)                                0.347 0.734770    
speciesEmpetrum nigrum:DroughtTrtExt (90)        -0.160 0.872607    
speciesVaccinium myrtillus:DroughtTrtExt (90)     1.768 0.077774 .  
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   2.023 0.043723 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.194                                          
spcsVccnmmy -0.180  0.467                                   
spcsVccvts- -0.194  0.501  0.467                            
DrghtTE(90) -0.707  0.137  0.127  0.137                     
sEn:DTE(90)  0.137 -0.708 -0.330 -0.355 -0.193              
sVm:DTE(90)  0.127 -0.329 -0.705 -0.329 -0.181  0.468       
sVv-:DTE(90  0.137 -0.355 -0.330 -0.708 -0.193  0.501  0.468
performance::check_model(tj_height_species_drought, detrend = FALSE)

tj_height_species_ageClass <- lmer(log(plant_height) ~ species * ageClass +
                                    (1 | DroughNet_plotID), 
                                  data = tjøtta_data)

summary(tj_height_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(plant_height) ~ species * ageClass + (1 | DroughNet_plotID)
   Data: tjøtta_data

REML criterion at convergence: 80.4

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.54225 -0.67111  0.01809  0.55517  2.32657 

Random effects:
 Groups           Name        Variance Std.Dev.
 DroughNet_plotID (Intercept) 0.04845  0.2201  
 Residual                     0.06084  0.2467  
Number of obs: 414, groups:  DroughNet_plotID, 12

Fixed effects:
                                              Estimate Std. Error        df
(Intercept)                                    3.02732    0.09593  12.09732
speciesEmpetrum nigrum                        -0.14878    0.04747 396.02754
speciesVaccinium myrtillus                    -0.42952    0.04747 396.02754
speciesVaccinium vitis-idaea                  -0.52368    0.04747 396.02754
ageClassPioneer                               -0.40256    0.13568  12.10416
speciesEmpetrum nigrum:ageClassPioneer        -0.04837    0.06717 396.06983
speciesVaccinium myrtillus:ageClassPioneer     0.03999    0.07223 397.04629
speciesVaccinium vitis-idaea:ageClassPioneer   0.14719    0.06717 396.06983
                                             t value Pr(>|t|)    
(Intercept)                                   31.558 5.44e-13 ***
speciesEmpetrum nigrum                        -3.134  0.00185 ** 
speciesVaccinium myrtillus                    -9.048  < 2e-16 ***
speciesVaccinium vitis-idaea                 -11.032  < 2e-16 ***
ageClassPioneer                               -2.967  0.01167 *  
speciesEmpetrum nigrum:ageClassPioneer        -0.720  0.47193    
speciesVaccinium myrtillus:ageClassPioneer     0.554  0.58017    
speciesVaccinium vitis-idaea:ageClassPioneer   2.191  0.02903 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- agClsP sEn:CP sVm:CP
spcsEmptrmn -0.247                                          
spcsVccnmmy -0.247  0.500                                   
spcsVccvts- -0.247  0.500  0.500                            
ageClassPnr -0.707  0.175  0.175  0.175                     
spcsEngr:CP  0.175 -0.707 -0.353 -0.353 -0.248              
spcsVmyr:CP  0.163 -0.329 -0.657 -0.329 -0.228  0.461       
spcsVvt-:CP  0.175 -0.353 -0.353 -0.707 -0.248  0.501  0.461
performance::check_model(tj_height_species_ageClass, detrend = FALSE)

tj_height_drought_ageClass <- lmer(log(plant_height) ~ DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID), 
                                  data = tjøtta_data)

summary(tj_height_drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(plant_height) ~ DroughtTrt * ageClass + (1 | DroughNet_plotID)
   Data: tjøtta_data

REML criterion at convergence: 243.5

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.64598 -0.72206  0.07496  0.82900  1.99762 

Random effects:
 Groups           Name        Variance Std.Dev.
 DroughNet_plotID (Intercept) 0.04341  0.2083  
 Residual                     0.09596  0.3098  
Number of obs: 414, groups:  DroughNet_plotID, 12

Fixed effects:
                                   Estimate Std. Error      df t value Pr(>|t|)
(Intercept)                          2.6002     0.1239  7.9725  20.982 2.92e-08
DroughtTrtExt (90)                   0.3033     0.1753  7.9725   1.730    0.122
ageClassPioneer                     -0.1697     0.1756  8.0296  -0.966    0.362
DroughtTrtExt (90):ageClassPioneer  -0.3653     0.2483  8.0261  -1.472    0.179
                                      
(Intercept)                        ***
DroughtTrtExt (90)                    
ageClassPioneer                       
DroughtTrtExt (90):ageClassPioneer    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) DrTE(90) agClsP
DrghtTE(90) -0.707                
ageClassPnr -0.706  0.499         
DrTE(90):CP  0.499 -0.706   -0.707
#validate model
performance::check_model(tj_height_drought_ageClass, detrend = FALSE)

three way

tj_height_species_drought_ageClass <- lmer(log(plant_height) ~ species * DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID), 
                                  data = tjøtta_data)
summary(tj_height_species_drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
log(plant_height) ~ species * DroughtTrt * ageClass + (1 | DroughNet_plotID)
   Data: tjøtta_data

REML criterion at convergence: 81.7

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-3.02197 -0.63267 -0.02741  0.69989  2.01395 

Random effects:
 Groups           Name        Variance Std.Dev.
 DroughNet_plotID (Intercept) 0.04271  0.2067  
 Residual                     0.05914  0.2432  
Number of obs: 414, groups:  DroughNet_plotID, 12

Fixed effects:
                                                                  Estimate
(Intercept)                                                      2.892e+00
speciesEmpetrum nigrum                                          -1.665e-01
speciesVaccinium myrtillus                                      -4.267e-01
speciesVaccinium vitis-idaea                                    -5.741e-01
DroughtTrtExt (90)                                               2.706e-01
ageClassPioneer                                                 -1.949e-01
speciesEmpetrum nigrum:DroughtTrtExt (90)                        3.547e-02
speciesVaccinium myrtillus:DroughtTrtExt (90)                   -5.569e-03
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  1.008e-01
speciesEmpetrum nigrum:ageClassPioneer                           2.635e-04
speciesVaccinium myrtillus:ageClassPioneer                      -1.221e-01
speciesVaccinium vitis-idaea:ageClassPioneer                     1.142e-01
DroughtTrtExt (90):ageClassPioneer                              -4.177e-01
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       -9.498e-02
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer    3.272e-01
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  6.821e-02
                                                                Std. Error
(Intercept)                                                      1.282e-01
speciesEmpetrum nigrum                                           6.619e-02
speciesVaccinium myrtillus                                       6.619e-02
speciesVaccinium vitis-idaea                                     6.619e-02
DroughtTrtExt (90)                                               1.813e-01
ageClassPioneer                                                  1.813e-01
speciesEmpetrum nigrum:DroughtTrtExt (90)                        9.360e-02
speciesVaccinium myrtillus:DroughtTrtExt (90)                    9.360e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  9.360e-02
speciesEmpetrum nigrum:ageClassPioneer                           9.372e-02
speciesVaccinium myrtillus:ageClassPioneer                       1.004e-01
speciesVaccinium vitis-idaea:ageClassPioneer                     9.372e-02
DroughtTrtExt (90):ageClassPioneer                               2.564e-01
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        1.325e-01
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer    1.424e-01
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  1.325e-01
                                                                        df
(Intercept)                                                      9.855e+00
speciesEmpetrum nigrum                                           3.900e+02
speciesVaccinium myrtillus                                       3.900e+02
speciesVaccinium vitis-idaea                                     3.900e+02
DroughtTrtExt (90)                                               9.855e+00
ageClassPioneer                                                  9.867e+00
speciesEmpetrum nigrum:DroughtTrtExt (90)                        3.900e+02
speciesVaccinium myrtillus:DroughtTrtExt (90)                    3.900e+02
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  3.900e+02
speciesEmpetrum nigrum:ageClassPioneer                           3.901e+02
speciesVaccinium myrtillus:ageClassPioneer                       3.909e+02
speciesVaccinium vitis-idaea:ageClassPioneer                     3.901e+02
DroughtTrtExt (90):ageClassPioneer                               9.861e+00
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        3.901e+02
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer    3.911e+02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer  3.901e+02
                                                                t value
(Intercept)                                                      22.565
speciesEmpetrum nigrum                                           -2.516
speciesVaccinium myrtillus                                       -6.447
speciesVaccinium vitis-idaea                                     -8.674
DroughtTrtExt (90)                                                1.493
ageClassPioneer                                                  -1.075
speciesEmpetrum nigrum:DroughtTrtExt (90)                         0.379
speciesVaccinium myrtillus:DroughtTrtExt (90)                    -0.059
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   1.077
speciesEmpetrum nigrum:ageClassPioneer                            0.003
speciesVaccinium myrtillus:ageClassPioneer                       -1.216
speciesVaccinium vitis-idaea:ageClassPioneer                      1.219
DroughtTrtExt (90):ageClassPioneer                               -1.629
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer        -0.717
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     2.297
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   0.515
                                                                Pr(>|t|)    
(Intercept)                                                     8.22e-10 ***
speciesEmpetrum nigrum                                            0.0123 *  
speciesVaccinium myrtillus                                      3.37e-10 ***
speciesVaccinium vitis-idaea                                     < 2e-16 ***
DroughtTrtExt (90)                                                0.1668    
ageClassPioneer                                                   0.3081    
speciesEmpetrum nigrum:DroughtTrtExt (90)                         0.7049    
speciesVaccinium myrtillus:DroughtTrtExt (90)                     0.9526    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   0.2822    
speciesEmpetrum nigrum:ageClassPioneer                            0.9978    
speciesVaccinium myrtillus:ageClassPioneer                        0.2246    
speciesVaccinium vitis-idaea:ageClassPioneer                      0.2237    
DroughtTrtExt (90):ageClassPioneer                                0.1348    
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         0.4738    
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.0221 *  
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   0.6069    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation matrix not shown by default, as p = 16 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it
#validate model
performance::check_model(tj_height_species_drought_ageClass, detrend = FALSE)

anova(tj_LDMC_species__drought_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                            Sum Sq Mean Sq NumDF   DenDF F value  Pr(>F)  
species                     1089.0   363.0     3 115.518  0.3688 0.77563  
DroughtTrt                    78.1    78.1     1   6.708  0.0793 0.78670  
ageClass                    5020.1  5020.1     1   6.708  5.1007 0.06008 .
species:DroughtTrt          2494.4   831.5     3 115.518  0.8448 0.47208  
species:ageClass            6323.1  2107.7     3 115.518  2.1416 0.09879 .
DroughtTrt:ageClass         5202.8  5202.8     1   6.708  5.2864 0.05664 .
species:DroughtTrt:ageClass 2974.4   991.5     3 115.518  1.0074 0.39221  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

trait2 - SLA

tj_sla_species_drought <- lmer(log(SLA) ~ species * DroughtTrt +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)

summary(tj_sla_species_drought)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(SLA) ~ species * DroughtTrt + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: -305.6

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.3518 -0.4402 -0.0015  0.3624  4.7774 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.025549 0.15984 
 DroughNet_plotID          (Intercept) 0.006568 0.08104 
 Residual                              0.013449 0.11597 
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                                  Estimate Std. Error
(Intercept)                                       4.212673   0.052716
speciesEmpetrum nigrum                            0.449105   0.057903
speciesVaccinium myrtillus                        1.174369   0.061246
speciesVaccinium vitis-idaea                      0.388370   0.057903
DroughtTrtExt (90)                                0.075215   0.074038
speciesEmpetrum nigrum:DroughtTrtExt (90)         0.007435   0.081420
speciesVaccinium myrtillus:DroughtTrtExt (90)    -0.148865   0.086195
speciesVaccinium vitis-idaea:DroughtTrtExt (90)  -0.089692   0.081420
                                                        df t value Pr(>|t|)    
(Intercept)                                      29.452558  79.912  < 2e-16 ***
speciesEmpetrum nigrum                          120.868500   7.756 3.09e-12 ***
speciesVaccinium myrtillus                      122.319578  19.174  < 2e-16 ***
speciesVaccinium vitis-idaea                    120.868500   6.707 6.75e-10 ***
DroughtTrtExt (90)                               28.726185   1.016   0.3182    
speciesEmpetrum nigrum:DroughtTrtExt (90)       121.211276   0.091   0.9274    
speciesVaccinium myrtillus:DroughtTrtExt (90)   122.985922  -1.727   0.0867 .  
speciesVaccinium vitis-idaea:DroughtTrtExt (90) 121.211276  -1.102   0.2728    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.552                                          
spcsVccnmmy -0.520  0.474                                   
spcsVccvts- -0.552  0.502  0.474                            
DrghtTE(90) -0.712  0.393  0.370  0.393                     
sEn:DTE(90)  0.392 -0.711 -0.337 -0.357 -0.546              
sVm:DTE(90)  0.370 -0.336 -0.711 -0.336 -0.515  0.468       
sVv-:DTE(90  0.392 -0.357 -0.337 -0.711 -0.546  0.497  0.468
performance::check_model(tj_sla_species_drought, detrend = FALSE)

tj_sla_species_ageClass <- lmer(log(SLA) ~ species * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)

summary(tj_sla_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(SLA) ~ species * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: -307

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.3523 -0.4478 -0.0153  0.3771  4.6738 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.025832 0.16072 
 DroughNet_plotID          (Intercept) 0.004446 0.06668 
 Residual                              0.013450 0.11597 
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                               Estimate Std. Error         df
(Intercept)                                    4.276755   0.048618  34.636800
speciesEmpetrum nigrum                         0.410340   0.057506 121.553393
speciesVaccinium myrtillus                     1.140151   0.057506 121.553393
speciesVaccinium vitis-idaea                   0.346289   0.057506 121.553393
ageClassPioneer                               -0.051910   0.069316  35.624965
speciesEmpetrum nigrum:ageClassPioneer         0.083925   0.081800 121.187450
speciesVaccinium myrtillus:ageClassPioneer    -0.113747   0.087661 124.057130
speciesVaccinium vitis-idaea:ageClassPioneer  -0.006568   0.081800 121.187450
                                             t value Pr(>|t|)    
(Intercept)                                   87.967  < 2e-16 ***
speciesEmpetrum nigrum                         7.136 7.60e-11 ***
speciesVaccinium myrtillus                    19.827  < 2e-16 ***
speciesVaccinium vitis-idaea                   6.022 1.89e-08 ***
ageClassPioneer                               -0.749    0.459    
speciesEmpetrum nigrum:ageClassPioneer         1.026    0.307    
speciesVaccinium myrtillus:ageClassPioneer    -1.298    0.197    
speciesVaccinium vitis-idaea:ageClassPioneer  -0.080    0.936    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- agClsP sEn:CP sVm:CP
spcsEmptrmn -0.580                                          
spcsVccnmmy -0.580  0.491                                   
spcsVccvts- -0.580  0.491  0.491                            
ageClassPnr -0.701  0.407  0.407  0.407                     
spcsEngr:CP  0.408 -0.703 -0.345 -0.345 -0.586              
spcsVmyr:CP  0.381 -0.322 -0.656 -0.322 -0.546  0.463       
spcsVvt-:CP  0.408 -0.345 -0.345 -0.703 -0.586  0.497  0.463
performance::check_model(tj_sla_species_ageClass, detrend = FALSE)

#xxx
tj_sla_drought_ageClass <- lmer(log(SLA) ~ DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)
boundary (singular) fit: see help('isSingular')
summary(tj_sla_drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(SLA) ~ DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: -88.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.1247 -0.4071 -0.0292  0.3386  4.5508 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.17513  0.4185  
 DroughNet_plotID          (Intercept) 0.00000  0.0000  
 Residual                              0.01345  0.1160  
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                    Estimate Std. Error        df t value
(Intercept)                          4.69380    0.07064 134.89158  66.451
DroughtTrtExt (90)                   0.10287    0.09926 135.09896   1.036
ageClassPioneer                     -0.02610    0.10217 135.04169  -0.255
DroughtTrtExt (90):ageClassPioneer  -0.16596    0.14403 135.06560  -1.152
                                   Pr(>|t|)    
(Intercept)                          <2e-16 ***
DroughtTrtExt (90)                    0.302    
ageClassPioneer                       0.799    
DroughtTrtExt (90):ageClassPioneer    0.251    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) DrTE(90) agClsP
DrghtTE(90) -0.712                
ageClassPnr -0.691  0.492         
DrTE(90):CP  0.490 -0.689   -0.709
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#validate model
performance::check_model(tj_sla_drought_ageClass, detrend = FALSE)

three way

tj_sla_species__drought_ageClass <- lmer(log(SLA) ~ species * DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)
summary(tj_sla_species__drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
log(SLA) ~ species * DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: -295.8

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.3200 -0.4441 -0.0213  0.3513  4.7276 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.02520  0.15875 
 DroughNet_plotID          (Intercept) 0.00345  0.05874 
 Residual                              0.01345  0.11597 
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                                                 Estimate
(Intercept)                                                       4.14754
speciesEmpetrum nigrum                                            0.47514
speciesVaccinium myrtillus                                        1.25978
speciesVaccinium vitis-idaea                                      0.45013
DroughtTrtExt (90)                                                0.25216
ageClassPioneer                                                   0.13020
speciesEmpetrum nigrum:DroughtTrtExt (90)                        -0.12333
speciesVaccinium myrtillus:DroughtTrtExt (90)                    -0.23299
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  -0.20140
speciesEmpetrum nigrum:ageClassPioneer                           -0.05200
speciesVaccinium myrtillus:ageClassPioneer                       -0.20507
speciesVaccinium vitis-idaea:ageClassPioneer                     -0.12344
DroughtTrtExt (90):ageClassPioneer                               -0.35749
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         0.26512
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.17218
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   0.22701
                                                                Std. Error
(Intercept)                                                        0.06670
speciesEmpetrum nigrum                                             0.08122
speciesVaccinium myrtillus                                         0.08122
speciesVaccinium vitis-idaea                                       0.08122
DroughtTrtExt (90)                                                 0.09308
ageClassPioneer                                                    0.09466
speciesEmpetrum nigrum:DroughtTrtExt (90)                          0.11385
speciesVaccinium myrtillus:DroughtTrtExt (90)                      0.11385
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                    0.11385
speciesEmpetrum nigrum:ageClassPioneer                             0.11514
speciesVaccinium myrtillus:ageClassPioneer                         0.12311
speciesVaccinium vitis-idaea:ageClassPioneer                       0.11514
DroughtTrtExt (90):ageClassPioneer                                 0.13276
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer          0.16192
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer      0.17334
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer    0.16192
                                                                       df
(Intercept)                                                      31.34880
speciesEmpetrum nigrum                                          113.53322
speciesVaccinium myrtillus                                      113.53322
speciesVaccinium vitis-idaea                                    113.53322
DroughtTrtExt (90)                                               29.95407
ageClassPioneer                                                  31.76762
speciesEmpetrum nigrum:DroughtTrtExt (90)                       114.90504
speciesVaccinium myrtillus:DroughtTrtExt (90)                   114.90504
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 114.90504
speciesEmpetrum nigrum:ageClassPioneer                          114.29937
speciesVaccinium myrtillus:ageClassPioneer                      117.16906
speciesVaccinium vitis-idaea:ageClassPioneer                    114.29937
DroughtTrtExt (90):ageClassPioneer                               30.85890
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer       114.59828
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer   117.83930
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer 114.59828
                                                                t value
(Intercept)                                                      62.186
speciesEmpetrum nigrum                                            5.850
speciesVaccinium myrtillus                                       15.511
speciesVaccinium vitis-idaea                                      5.542
DroughtTrtExt (90)                                                2.709
ageClassPioneer                                                   1.375
speciesEmpetrum nigrum:DroughtTrtExt (90)                        -1.083
speciesVaccinium myrtillus:DroughtTrtExt (90)                    -2.047
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  -1.769
speciesEmpetrum nigrum:ageClassPioneer                           -0.452
speciesVaccinium myrtillus:ageClassPioneer                       -1.666
speciesVaccinium vitis-idaea:ageClassPioneer                     -1.072
DroughtTrtExt (90):ageClassPioneer                               -2.693
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         1.637
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.993
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   1.402
                                                                Pr(>|t|)    
(Intercept)                                                      < 2e-16 ***
speciesEmpetrum nigrum                                          4.83e-08 ***
speciesVaccinium myrtillus                                       < 2e-16 ***
speciesVaccinium vitis-idaea                                    1.97e-07 ***
DroughtTrtExt (90)                                                0.0110 *  
ageClassPioneer                                                   0.1786    
speciesEmpetrum nigrum:DroughtTrtExt (90)                         0.2809    
speciesVaccinium myrtillus:DroughtTrtExt (90)                     0.0430 *  
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   0.0795 .  
speciesEmpetrum nigrum:ageClassPioneer                            0.6524    
speciesVaccinium myrtillus:ageClassPioneer                        0.0984 .  
speciesVaccinium vitis-idaea:ageClassPioneer                      0.2859    
DroughtTrtExt (90):ageClassPioneer                                0.0113 *  
speciesEmpetrum nigrum:DroughtTrtExt (90):ageClassPioneer         0.1043    
speciesVaccinium myrtillus:DroughtTrtExt (90):ageClassPioneer     0.3226    
speciesVaccinium vitis-idaea:DroughtTrtExt (90):ageClassPioneer   0.1636    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation matrix not shown by default, as p = 16 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it
#validate model
performance::check_model(tj_sla_species__drought_ageClass, detrend = FALSE)

anova(tj_sla_species__drought_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                            Sum Sq Mean Sq NumDF   DenDF  F value  Pr(>F)    
species                     8.5856 2.86185     3 115.711 212.7792 < 2e-16 ***
DroughtTrt                  0.0019 0.00192     1   6.941   0.1426 0.71697    
ageClass                    0.0243 0.02432     1   6.941   1.8085 0.22097    
species:DroughtTrt          0.0601 0.02005     3 115.711   1.4904 0.22086    
species:ageClass            0.0710 0.02368     3 115.711   1.7604 0.15865    
DroughtTrt:ageClass         0.0606 0.06060     1   6.941   4.5057 0.07177 .  
species:DroughtTrt:ageClass 0.0423 0.01410     3 115.711   1.0482 0.37408    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

trait 4: mean thickness

tj_thickness_species_drought <- lmer(mean_thickness ~ species * DroughtTrt +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)

summary(tj_thickness_species_drought)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
mean_thickness ~ species * DroughtTrt + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: -1192.7

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.8965 -0.2983  0.0174  0.2987  4.6857 

Random effects:
 Groups                    Name        Variance  Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.0017499 0.04183 
 DroughNet_plotID          (Intercept) 0.0002074 0.01440 
 Residual                              0.0018287 0.04276 
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                                 Estimate Std. Error        df
(Intercept)                                       0.50456    0.01294  50.86041
speciesEmpetrum nigrum                           -0.29156    0.01624 118.20073
speciesVaccinium myrtillus                       -0.38462    0.01712 120.26302
speciesVaccinium vitis-idaea                     -0.19394    0.01624 118.20073
DroughtTrtExt (90)                               -0.01822    0.01815  49.71531
speciesEmpetrum nigrum:DroughtTrtExt (90)         0.02493    0.02285 118.84866
speciesVaccinium myrtillus:DroughtTrtExt (90)     0.03603    0.02411 121.33657
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   0.01527    0.02285 118.84866
                                                t value Pr(>|t|)    
(Intercept)                                      39.002   <2e-16 ***
speciesEmpetrum nigrum                          -17.949   <2e-16 ***
speciesVaccinium myrtillus                      -22.462   <2e-16 ***
speciesVaccinium vitis-idaea                    -11.939   <2e-16 ***
DroughtTrtExt (90)                               -1.004    0.320    
speciesEmpetrum nigrum:DroughtTrtExt (90)         1.091    0.277    
speciesVaccinium myrtillus:DroughtTrtExt (90)     1.494    0.138    
speciesVaccinium vitis-idaea:DroughtTrtExt (90)   0.668    0.505    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DTE(90 sEn:D( sVm:D(
spcsEmptrmn -0.632                                          
spcsVccnmmy -0.598  0.476                                   
spcsVccvts- -0.632  0.503  0.476                            
DrghtTE(90) -0.713  0.451  0.426  0.451                     
sEn:DTE(90)  0.449 -0.711 -0.338 -0.358 -0.627              
sVm:DTE(90)  0.424 -0.338 -0.710 -0.338 -0.593  0.471       
sVv-:DTE(90  0.449 -0.358 -0.338 -0.711 -0.627  0.498  0.471
performance::check_model(tj_thickness_species_drought, detrend = FALSE)

tj_thickness_species_ageClass <- lmer(mean_thickness ~ species * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)

summary(tj_thickness_species_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: mean_thickness ~ species * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: -1194.7

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.9392 -0.3099  0.0075  0.2923  4.6451 

Random effects:
 Groups                    Name        Variance  Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.0017354 0.04166 
 DroughNet_plotID          (Intercept) 0.0001687 0.01299 
 Residual                              0.0018279 0.04275 
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                              Estimate Std. Error        df
(Intercept)                                    0.51299    0.01244  52.86572
speciesEmpetrum nigrum                        -0.29305    0.01602 119.84736
speciesVaccinium myrtillus                    -0.38359    0.01602 119.84736
speciesVaccinium vitis-idaea                  -0.20435    0.01602 119.84736
ageClassPioneer                               -0.03610    0.01774  54.10279
speciesEmpetrum nigrum:ageClassPioneer         0.02893    0.02278 119.16704
speciesVaccinium myrtillus:ageClassPioneer     0.03602    0.02433 122.48041
speciesVaccinium vitis-idaea:ageClassPioneer   0.03712    0.02278 119.16704
                                             t value Pr(>|t|)    
(Intercept)                                   41.254   <2e-16 ***
speciesEmpetrum nigrum                       -18.288   <2e-16 ***
speciesVaccinium myrtillus                   -23.939   <2e-16 ***
speciesVaccinium vitis-idaea                 -12.753   <2e-16 ***
ageClassPioneer                               -2.035   0.0467 *  
speciesEmpetrum nigrum:ageClassPioneer         1.270   0.2066    
speciesVaccinium myrtillus:ageClassPioneer     1.481   0.1413    
speciesVaccinium vitis-idaea:ageClassPioneer   1.629   0.1059    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- agClsP sEn:CP sVm:CP
spcsEmptrmn -0.635                                          
spcsVccnmmy -0.635  0.493                                   
spcsVccvts- -0.635  0.493  0.493                            
ageClassPnr -0.701  0.445  0.445  0.445                     
spcsEngr:CP  0.447 -0.703 -0.347 -0.347 -0.640              
spcsVmyr:CP  0.418 -0.325 -0.659 -0.325 -0.598  0.466       
spcsVvt-:CP  0.447 -0.347 -0.347 -0.703 -0.640  0.498  0.466
performance::check_model(tj_thickness_species_ageClass, detrend = FALSE)

#xxx
tj_thickness_drought_ageClass <- lmer(mean_thickness ~ DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)
boundary (singular) fit: see help('isSingular')
summary(tj_thickness_drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
mean_thickness ~ DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: -926.9

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.6863 -0.3118 -0.0150  0.3007  5.3410 

Random effects:
 Groups                    Name        Variance  Std.Dev. 
 plant_nr:DroughNet_plotID (Intercept) 2.067e-02 1.438e-01
 DroughNet_plotID          (Intercept) 5.961e-13 7.721e-07
 Residual                              1.816e-03 4.262e-02
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                     Estimate Std. Error         df t value
(Intercept)                          0.291606   0.024308 134.781211  11.996
DroughtTrtExt (90)                   0.007057   0.034159 135.015006   0.207
ageClassPioneer                      0.005165   0.035161 134.949268   0.147
DroughtTrtExt (90):ageClassPioneer  -0.009869   0.049567 134.976806  -0.199
                                   Pr(>|t|)    
(Intercept)                          <2e-16 ***
DroughtTrtExt (90)                    0.837    
ageClassPioneer                       0.883    
DroughtTrtExt (90):ageClassPioneer    0.842    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) DrTE(90) agClsP
DrghtTE(90) -0.712                
ageClassPnr -0.691  0.492         
DrTE(90):CP  0.490 -0.689   -0.709
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
#validate model
performance::check_model(tj_thickness_drought_ageClass, detrend = FALSE)

three way

tj_thickness_species_drought_ageClass <- lmer(mean_thickness ~ species + DroughtTrt * ageClass +
                                    (1 | DroughNet_plotID/plant_nr), 
                                  data = tjøtta_data)
summary(tj_thickness_species_drought_ageClass)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
mean_thickness ~ species + DroughtTrt * ageClass + (1 | DroughNet_plotID/plant_nr)
   Data: tjøtta_data

REML criterion at convergence: -1196.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.8494 -0.2986  0.0096  0.2922  4.7343 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.001748 0.04181 
 DroughNet_plotID          (Intercept) 0.000245 0.01565 
 Residual                              0.001828 0.04276 
Number of obs: 414, groups:  
plant_nr:DroughNet_plotID, 139; DroughNet_plotID, 12

Fixed effects:
                                     Estimate Std. Error         df t value
(Intercept)                          0.499571   0.014031  13.880428  35.605
speciesEmpetrum nigrum              -0.278857   0.011421 121.933291 -24.417
speciesVaccinium myrtillus          -0.366939   0.012071 123.933500 -30.399
speciesVaccinium vitis-idaea        -0.186067   0.011421 121.933291 -16.292
DroughtTrtExt (90)                   0.002478   0.017127   7.772347   0.145
ageClassPioneer                     -0.008661   0.017384   8.197532  -0.498
DroughtTrtExt (90):ageClassPioneer  -0.005061   0.024526   8.133198  -0.206
                                   Pr(>|t|)    
(Intercept)                        4.84e-15 ***
speciesEmpetrum nigrum              < 2e-16 ***
speciesVaccinium myrtillus          < 2e-16 ***
speciesVaccinium vitis-idaea        < 2e-16 ***
DroughtTrtExt (90)                    0.889    
ageClassPioneer                       0.631    
DroughtTrtExt (90):ageClassPioneer    0.842    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) spcsEn spcsVm spcVv- DrTE(90) agClsP
spcsEmptrmn -0.406                                     
spcsVccnmmy -0.406  0.470                              
spcsVccvts- -0.406  0.498  0.470                       
DrghtTE(90) -0.615  0.005  0.005  0.005                
ageClassPnr -0.610 -0.003  0.035 -0.003  0.494         
DrTE(90):CP  0.429 -0.001 -0.002 -0.001 -0.698   -0.707
#validate model
performance::check_model(tj_thickness_species_drought_ageClass, detrend = FALSE)

anova(tj_thickness_species_drought_ageClass)
Type III Analysis of Variance Table with Satterthwaite's method
                     Sum Sq Mean Sq NumDF   DenDF  F value Pr(>F)    
species             1.93712 0.64571     3 122.323 353.2121 <2e-16 ***
DroughtTrt          0.00000 0.00000     1   8.134   0.0000 0.9967    
ageClass            0.00152 0.00152     1   8.181   0.8297 0.3884    
DroughtTrt:ageClass 0.00008 0.00008     1   8.133   0.0426 0.8416    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

young and old leaves (lygra)

# Subset the data for the specified species with young and old leaves, and for the Lygra site
subset_data1 <- subset(droughtnet_data2_clean, species %in% c("Vaccinium vitis-idaea", "Empetrum nigrum") & siteID == "Lygra")

# View the first few rows of the subsetted data
View(subset_data1)

LDMC

ldmc_three_way_interactions <- lmer(LDMC ~ species * DroughtTrt * leaf_age +
                                (1 | DroughNet_plotID/plant_nr), 
                              data = subset_data1)

summary(ldmc_three_way_interactions)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
LDMC ~ species * DroughtTrt * leaf_age + (1 | DroughNet_plotID/plant_nr)
   Data: subset_data1

REML criterion at convergence: 3929.6

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.2591 -0.5311  0.0201  0.5473  4.1171 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept)  255.70  15.991  
 DroughNet_plotID          (Intercept)   83.39   9.132  
 Residual                              3655.25  60.459  
Number of obs: 359, groups:  
plant_nr:DroughNet_plotID, 64; DroughNet_plotID, 12

Fixed effects:
                                                              Estimate
(Intercept)                                                    512.539
speciesVaccinium vitis-idaea                                    -6.515
DroughtTrtExt (90)                                              15.972
leaf_ageyoung                                                  -97.955
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                -15.627
speciesVaccinium vitis-idaea:leaf_ageyoung                    -119.104
DroughtTrtExt (90):leaf_ageyoung                               -58.030
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung   95.427
                                                              Std. Error
(Intercept)                                                       10.795
speciesVaccinium vitis-idaea                                      14.060
DroughtTrtExt (90)                                                15.751
leaf_ageyoung                                                     12.847
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   19.988
speciesVaccinium vitis-idaea:leaf_ageyoung                        18.242
DroughtTrtExt (90):leaf_ageyoung                                  18.805
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung     25.773
                                                                    df t value
(Intercept)                                                     59.270  47.481
speciesVaccinium vitis-idaea                                   154.421  -0.463
DroughtTrtExt (90)                                              61.817   1.014
leaf_ageyoung                                                  300.421  -7.625
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                152.613  -0.782
speciesVaccinium vitis-idaea:leaf_ageyoung                     307.748  -6.529
DroughtTrtExt (90):leaf_ageyoung                               301.286  -3.086
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  305.326   3.703
                                                              Pr(>|t|)    
(Intercept)                                                    < 2e-16 ***
speciesVaccinium vitis-idaea                                  0.643784    
DroughtTrtExt (90)                                            0.314505    
leaf_ageyoung                                                 3.23e-13 ***
speciesVaccinium vitis-idaea:DroughtTrtExt (90)               0.435554    
speciesVaccinium vitis-idaea:leaf_ageyoung                    2.73e-10 ***
DroughtTrtExt (90):leaf_ageyoung                              0.002218 ** 
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung 0.000253 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) spcVv- DrTE(90) lf_gyn spVv-:DTE(90) sVv-:_ DTE(90):
spcsVccvts-   -0.678                                                     
DrghtTE(90)   -0.685  0.464                                              
leaf_ageyng   -0.602  0.462  0.412                                       
spVv-:DTE(90)  0.477 -0.703 -0.700   -0.325                              
spcsVvts-:_    0.420 -0.626 -0.288   -0.704  0.441                       
DrgTE(90):_    0.411 -0.315 -0.601   -0.683  0.474         0.481         
sVv-:DTE(90): -0.297  0.443  0.435    0.498 -0.631        -0.708 -0.730  
performance::check_model(ldmc_three_way_interactions, detrend = FALSE)

SLA

sla_three_way_interactions <- lmer(log(SLA) ~ species * DroughtTrt * leaf_age +
                                (1 | DroughNet_plotID/plant_nr), 
                              data = subset_data1)

summary(sla_three_way_interactions)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
log(SLA) ~ species * DroughtTrt * leaf_age + (1 | DroughNet_plotID/plant_nr)
   Data: subset_data1

REML criterion at convergence: 6.4

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.9514 -0.4817 -0.0359  0.4532  5.0252 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.007835 0.08851 
 DroughNet_plotID          (Intercept) 0.002775 0.05268 
 Residual                              0.048131 0.21939 
Number of obs: 359, groups:  
plant_nr:DroughNet_plotID, 64; DroughNet_plotID, 12

Fixed effects:
                                                               Estimate
(Intercept)                                                     4.15087
speciesVaccinium vitis-idaea                                   -0.06011
DroughtTrtExt (90)                                             -0.08605
leaf_ageyoung                                                   0.54079
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 0.07364
speciesVaccinium vitis-idaea:leaf_ageyoung                      0.34166
DroughtTrtExt (90):leaf_ageyoung                                0.16645
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  -0.32895
                                                              Std. Error
(Intercept)                                                      0.04625
speciesVaccinium vitis-idaea                                     0.05682
DroughtTrtExt (90)                                               0.06741
leaf_ageyoung                                                    0.04669
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  0.08077
speciesVaccinium vitis-idaea:leaf_ageyoung                       0.06646
DroughtTrtExt (90):leaf_ageyoung                                 0.06837
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung    0.09382
                                                                     df t value
(Intercept)                                                    38.83645  89.745
speciesVaccinium vitis-idaea                                  120.58349  -1.058
DroughtTrtExt (90)                                             41.29305  -1.277
leaf_ageyoung                                                 296.33089  11.581
speciesVaccinium vitis-idaea:DroughtTrtExt (90)               119.36818   0.912
speciesVaccinium vitis-idaea:leaf_ageyoung                    303.08399   5.141
DroughtTrtExt (90):leaf_ageyoung                              296.96765   2.435
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung 300.88167  -3.506
                                                              Pr(>|t|)    
(Intercept)                                                    < 2e-16 ***
speciesVaccinium vitis-idaea                                  0.292191    
DroughtTrtExt (90)                                            0.208891    
leaf_ageyoung                                                  < 2e-16 ***
speciesVaccinium vitis-idaea:DroughtTrtExt (90)               0.363778    
speciesVaccinium vitis-idaea:leaf_ageyoung                    4.92e-07 ***
DroughtTrtExt (90):leaf_ageyoung                              0.015493 *  
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung 0.000524 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) spcVv- DrTE(90) lf_gyn spVv-:DTE(90) sVv-:_ DTE(90):
spcsVccvts-   -0.641                                                     
DrghtTE(90)   -0.686  0.440                                              
leaf_ageyng   -0.510  0.415  0.350                                       
spVv-:DTE(90)  0.451 -0.703 -0.665   -0.292                              
spcsVvts-:_    0.354 -0.560 -0.243   -0.703  0.394                       
DrgTE(90):_    0.349 -0.283 -0.511   -0.683  0.426         0.480         
sVv-:DTE(90): -0.251  0.396  0.368    0.498 -0.565        -0.708 -0.729  
performance::check_model(sla_three_way_interactions, detrend = FALSE)

anova(sla_three_way_interactions)
Type III Analysis of Variance Table with Satterthwaite's method
                            Sum Sq Mean Sq NumDF   DenDF  F value    Pr(>F)    
species                      0.185   0.185     1  58.119   3.8378 0.0549135 .  
DroughtTrt                   0.056   0.056     1  10.950   1.1535 0.3059085    
leaf_age                    44.411  44.411     1 300.758 922.7157 < 2.2e-16 ***
species:DroughtTrt           0.089   0.089     1  58.119   1.8567 0.1782642    
species:leaf_age             0.687   0.687     1 300.882  14.2644 0.0001914 ***
DroughtTrt:leaf_age          0.000   0.000     1 300.758   0.0018 0.9664086    
species:DroughtTrt:leaf_age  0.592   0.592     1 300.882  12.2924 0.0005241 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

mean thickness

thickness_three_way_interactions <- lmer(mean_thickness ~ species * DroughtTrt * leaf_age +
                                (1 | DroughNet_plotID/plant_nr), 
                              data = subset_data1)

summary(thickness_three_way_interactions)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
mean_thickness ~ species * DroughtTrt * leaf_age + (1 | DroughNet_plotID/plant_nr)
   Data: subset_data1

REML criterion at convergence: -1029.1

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.7710 -0.5215 -0.0474  0.4526  4.7564 

Random effects:
 Groups                    Name        Variance  Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.0014482 0.03806 
 DroughNet_plotID          (Intercept) 0.0002531 0.01591 
 Residual                              0.0021637 0.04652 
Number of obs: 359, groups:  
plant_nr:DroughNet_plotID, 64; DroughNet_plotID, 12

Fixed effects:
                                                                Estimate
(Intercept)                                                    2.811e-01
speciesVaccinium vitis-idaea                                   6.423e-02
DroughtTrtExt (90)                                            -3.380e-02
leaf_ageyoung                                                 -7.018e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                5.219e-02
speciesVaccinium vitis-idaea:leaf_ageyoung                     8.889e-04
DroughtTrtExt (90):leaf_ageyoung                               1.924e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung -2.005e-02
                                                              Std. Error
(Intercept)                                                    1.380e-02
speciesVaccinium vitis-idaea                                   1.698e-02
DroughtTrtExt (90)                                             2.014e-02
leaf_ageyoung                                                  9.929e-03
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                2.415e-02
speciesVaccinium vitis-idaea:leaf_ageyoung                     1.419e-02
DroughtTrtExt (90):leaf_ageyoung                               1.454e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  2.001e-02
                                                                      df
(Intercept)                                                    2.691e+01
speciesVaccinium vitis-idaea                                   8.123e+01
DroughtTrtExt (90)                                             2.860e+01
leaf_ageyoung                                                  2.938e+02
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                8.110e+01
speciesVaccinium vitis-idaea:leaf_ageyoung                     2.978e+02
DroughtTrtExt (90):leaf_ageyoung                               2.940e+02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  2.965e+02
                                                              t value Pr(>|t|)
(Intercept)                                                    20.376  < 2e-16
speciesVaccinium vitis-idaea                                    3.783 0.000295
DroughtTrtExt (90)                                             -1.679 0.104106
leaf_ageyoung                                                  -7.069 1.14e-11
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 2.161 0.033605
speciesVaccinium vitis-idaea:leaf_ageyoung                      0.063 0.950097
DroughtTrtExt (90):leaf_ageyoung                                1.323 0.186881
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  -1.002 0.317068
                                                                 
(Intercept)                                                   ***
speciesVaccinium vitis-idaea                                  ***
DroughtTrtExt (90)                                               
leaf_ageyoung                                                 ***
speciesVaccinium vitis-idaea:DroughtTrtExt (90)               *  
speciesVaccinium vitis-idaea:leaf_ageyoung                       
DroughtTrtExt (90):leaf_ageyoung                                 
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) spcVv- DrTE(90) lf_gyn spVv-:DTE(90) sVv-:_ DTE(90):
spcsVccvts-   -0.635                                                     
DrghtTE(90)   -0.685  0.435                                              
leaf_ageyng   -0.363  0.294  0.249                                       
spVv-:DTE(90)  0.447 -0.703 -0.661   -0.207                              
spcsVvts-:_    0.251 -0.396 -0.172   -0.700  0.278                       
DrgTE(90):_    0.248 -0.201 -0.364   -0.683  0.304         0.478         
sVv-:DTE(90): -0.178  0.281  0.261    0.496 -0.400        -0.709 -0.727  
performance::check_model(thickness_three_way_interactions, detrend = FALSE)

young and old leaves (tjøtta)

# Subset the data for the specified species with young and old leaves, and for the Lygra site
subset_data2 <- subset(droughtnet_data2_clean, species %in% c("Vaccinium vitis-idaea", "Empetrum nigrum") & siteID == "Tjøtta")

# View the first few rows of the subsetted data
View(subset_data2)

LDMC

ldmc1_three_way_interactions <- lmer(LDMC ~ species * DroughtTrt * leaf_age +
                                (1 | DroughNet_plotID/plant_nr), 
                              data = subset_data2)

summary(ldmc1_three_way_interactions)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
LDMC ~ species * DroughtTrt * leaf_age + (1 | DroughNet_plotID/plant_nr)
   Data: subset_data2

REML criterion at convergence: 4402.1

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-5.4122 -0.4657  0.0166  0.5113  7.1929 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept)  487.0   22.07   
 DroughNet_plotID          (Intercept)  644.7   25.39   
 Residual                              1400.8   37.43   
Number of obs: 432, groups:  
plant_nr:DroughNet_plotID, 72; DroughNet_plotID, 12

Fixed effects:
                                                              Estimate
(Intercept)                                                    440.762
speciesVaccinium vitis-idaea                                    31.544
DroughtTrtExt (90)                                             -32.778
leaf_ageyoung                                                  -72.626
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 23.743
speciesVaccinium vitis-idaea:leaf_ageyoung                     -37.350
DroughtTrtExt (90):leaf_ageyoung                                17.403
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung    4.946
                                                              Std. Error
(Intercept)                                                       12.667
speciesVaccinium vitis-idaea                                      10.296
DroughtTrtExt (90)                                                17.917
leaf_ageyoung                                                      7.203
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                   14.564
speciesVaccinium vitis-idaea:leaf_ageyoung                        10.187
DroughtTrtExt (90):leaf_ageyoung                                  10.192
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung     14.410
                                                                   df t value
(Intercept)                                                    15.774  34.796
speciesVaccinium vitis-idaea                                  100.343   3.064
DroughtTrtExt (90)                                             15.784  -1.829
leaf_ageyoung                                                 356.281 -10.083
speciesVaccinium vitis-idaea:DroughtTrtExt (90)               100.377   1.630
speciesVaccinium vitis-idaea:leaf_ageyoung                    356.281  -3.667
DroughtTrtExt (90):leaf_ageyoung                              356.651   1.708
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung 356.466   0.343
                                                              Pr(>|t|)    
(Intercept)                                                   2.43e-16 ***
speciesVaccinium vitis-idaea                                  0.002806 ** 
DroughtTrtExt (90)                                            0.086290 .  
leaf_ageyoung                                                  < 2e-16 ***
speciesVaccinium vitis-idaea:DroughtTrtExt (90)               0.106180    
speciesVaccinium vitis-idaea:leaf_ageyoung                    0.000283 ***
DroughtTrtExt (90):leaf_ageyoung                              0.088596 .  
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung 0.731601    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) spcVv- DrTE(90) lf_gyn spVv-:DTE(90) sVv-:_ DTE(90):
spcsVccvts-   -0.406                                                     
DrghtTE(90)   -0.707  0.287                                              
leaf_ageyng   -0.284  0.350  0.201                                       
spVv-:DTE(90)  0.287 -0.707 -0.407   -0.247                              
spcsVvts-:_    0.201 -0.495 -0.142   -0.707  0.350                       
DrgTE(90):_    0.201 -0.247 -0.285   -0.707  0.350         0.500         
sVv-:DTE(90): -0.142  0.350  0.201    0.500 -0.495        -0.707 -0.707  
performance::check_model(ldmc1_three_way_interactions, detrend = FALSE)

SLA

sla2_three_way_interactions <- lmer(log(SLA) ~ species * DroughtTrt * leaf_age +
                                (1 | DroughNet_plotID/plant_nr), 
                              data = subset_data2)

summary(sla2_three_way_interactions)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
log(SLA) ~ species * DroughtTrt * leaf_age + (1 | DroughNet_plotID/plant_nr)
   Data: subset_data2

REML criterion at convergence: -321.3

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.2721 -0.5233 -0.0683  0.4807  5.4552 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.009562 0.09778 
 DroughNet_plotID          (Intercept) 0.009974 0.09987 
 Residual                              0.019625 0.14009 
Number of obs: 432, groups:  
plant_nr:DroughNet_plotID, 72; DroughNet_plotID, 12

Fixed effects:
                                                                Estimate
(Intercept)                                                    4.168e+00
speciesVaccinium vitis-idaea                                  -9.374e-02
DroughtTrtExt (90)                                             8.247e-02
leaf_ageyoung                                                  4.937e-01
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                1.839e-02
speciesVaccinium vitis-idaea:leaf_ageyoung                     3.300e-02
DroughtTrtExt (90):leaf_ageyoung                               1.791e-04
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung -1.155e-01
                                                              Std. Error
(Intercept)                                                    5.057e-02
speciesVaccinium vitis-idaea                                   4.230e-02
DroughtTrtExt (90)                                             7.152e-02
leaf_ageyoung                                                  2.696e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                5.984e-02
speciesVaccinium vitis-idaea:leaf_ageyoung                     3.813e-02
DroughtTrtExt (90):leaf_ageyoung                               3.815e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  5.394e-02
                                                                      df
(Intercept)                                                    1.595e+01
speciesVaccinium vitis-idaea                                   9.089e+01
DroughtTrtExt (90)                                             1.596e+01
leaf_ageyoung                                                  3.564e+02
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                9.094e+01
speciesVaccinium vitis-idaea:leaf_ageyoung                     3.564e+02
DroughtTrtExt (90):leaf_ageyoung                               3.567e+02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  3.566e+02
                                                              t value Pr(>|t|)
(Intercept)                                                    82.427   <2e-16
speciesVaccinium vitis-idaea                                   -2.216   0.0292
DroughtTrtExt (90)                                              1.153   0.2659
leaf_ageyoung                                                  18.312   <2e-16
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                 0.307   0.7593
speciesVaccinium vitis-idaea:leaf_ageyoung                      0.866   0.3873
DroughtTrtExt (90):leaf_ageyoung                                0.005   0.9963
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  -2.142   0.0329
                                                                 
(Intercept)                                                   ***
speciesVaccinium vitis-idaea                                  *  
DroughtTrtExt (90)                                               
leaf_ageyoung                                                 ***
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  
speciesVaccinium vitis-idaea:leaf_ageyoung                       
DroughtTrtExt (90):leaf_ageyoung                                 
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) spcVv- DrTE(90) lf_gyn spVv-:DTE(90) sVv-:_ DTE(90):
spcsVccvts-   -0.418                                                     
DrghtTE(90)   -0.707  0.296                                              
leaf_ageyng   -0.267  0.319  0.188                                       
spVv-:DTE(90)  0.296 -0.707 -0.418   -0.225                              
spcsVvts-:_    0.189 -0.451 -0.133   -0.707  0.319                       
DrgTE(90):_    0.188 -0.225 -0.267   -0.707  0.319         0.500         
sVv-:DTE(90): -0.133  0.319  0.189    0.500 -0.451        -0.707 -0.707  
performance::check_model(sla2_three_way_interactions, detrend = FALSE)

mean thickness

thickness3_three_way_interactions <- lmer(mean_thickness ~ species * DroughtTrt * leaf_age +
                                (1 | DroughNet_plotID/plant_nr), 
                              data = subset_data2)

summary(thickness3_three_way_interactions)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
mean_thickness ~ species * DroughtTrt * leaf_age + (1 | DroughNet_plotID/plant_nr)
   Data: subset_data2

REML criterion at convergence: -1435.9

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.7996 -0.5906 -0.0075  0.5830  3.3296 

Random effects:
 Groups                    Name        Variance  Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.0011483 0.03389 
 DroughNet_plotID          (Intercept) 0.0001187 0.01090 
 Residual                              0.0013626 0.03691 
Number of obs: 432, groups:  
plant_nr:DroughNet_plotID, 72; DroughNet_plotID, 12

Fixed effects:
                                                                Estimate
(Intercept)                                                    3.060e-01
speciesVaccinium vitis-idaea                                   7.146e-02
DroughtTrtExt (90)                                            -9.305e-03
leaf_ageyoung                                                 -9.302e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90)               -2.199e-04
speciesVaccinium vitis-idaea:leaf_ageyoung                     2.616e-02
DroughtTrtExt (90):leaf_ageyoung                               1.602e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung -9.447e-03
                                                              Std. Error
(Intercept)                                                    1.043e-02
speciesVaccinium vitis-idaea                                   1.334e-02
DroughtTrtExt (90)                                             1.476e-02
leaf_ageyoung                                                  7.104e-03
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                1.887e-02
speciesVaccinium vitis-idaea:leaf_ageyoung                     1.005e-02
DroughtTrtExt (90):leaf_ageyoung                               1.005e-02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  1.421e-02
                                                                      df
(Intercept)                                                    3.273e+01
speciesVaccinium vitis-idaea                                   7.855e+01
DroughtTrtExt (90)                                             3.277e+01
leaf_ageyoung                                                  3.562e+02
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                7.859e+01
speciesVaccinium vitis-idaea:leaf_ageyoung                     3.562e+02
DroughtTrtExt (90):leaf_ageyoung                               3.564e+02
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  3.563e+02
                                                              t value Pr(>|t|)
(Intercept)                                                    29.336  < 2e-16
speciesVaccinium vitis-idaea                                    5.355 8.26e-07
DroughtTrtExt (90)                                             -0.631  0.53271
leaf_ageyoung                                                 -13.094  < 2e-16
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                -0.012  0.99073
speciesVaccinium vitis-idaea:leaf_ageyoung                      2.604  0.00959
DroughtTrtExt (90):leaf_ageyoung                                1.594  0.11191
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung  -0.665  0.50669
                                                                 
(Intercept)                                                   ***
speciesVaccinium vitis-idaea                                  ***
DroughtTrtExt (90)                                               
leaf_ageyoung                                                 ***
speciesVaccinium vitis-idaea:DroughtTrtExt (90)                  
speciesVaccinium vitis-idaea:leaf_ageyoung                    ** 
DroughtTrtExt (90):leaf_ageyoung                                 
speciesVaccinium vitis-idaea:DroughtTrtExt (90):leaf_ageyoung    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) spcVv- DrTE(90) lf_gyn spVv-:DTE(90) sVv-:_ DTE(90):
spcsVccvts-   -0.640                                                     
DrghtTE(90)   -0.707  0.452                                              
leaf_ageyng   -0.341  0.266  0.241                                       
spVv-:DTE(90)  0.452 -0.707 -0.640   -0.188                              
spcsVvts-:_    0.241 -0.376 -0.170   -0.707  0.266                       
DrgTE(90):_    0.241 -0.188 -0.341   -0.707  0.267         0.500         
sVv-:DTE(90): -0.170  0.266  0.241    0.500 -0.377        -0.707 -0.707  
performance::check_model(thickness3_three_way_interactions, detrend = FALSE)

CALLUNA SHOOT TYPE (lygra)

# Create a data frame for Calluna vulgaris at the Lygra site and remove rows with NA values
calluna_shoot <- droughtnet_data2_clean %>%
  filter(species == "Calluna vulgaris" & siteID == "Lygra") %>%
  drop_na()

view(calluna_shoot)

LDMC

shoot_type_lmdc3 <- lmer(LDMC ~ (calluna_shoot_type * DroughtTrt * ageClass) +
                               (1 | DroughNet_plotID/plant_nr), 
                             data = calluna_shoot)
summary(shoot_type_lmdc3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: 
LDMC ~ (calluna_shoot_type * DroughtTrt * ageClass) + (1 | DroughNet_plotID/plant_nr)
   Data: calluna_shoot

REML criterion at convergence: 1851.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.2601 -0.5085  0.0443  0.6453  2.4919 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 609.66   24.69   
 DroughNet_plotID          (Intercept)  56.55    7.52   
 Residual                              758.85   27.55   
Number of obs: 195, groups:  
plant_nr:DroughNet_plotID, 36; DroughNet_plotID, 12

Fixed effects:
                                                           Estimate Std. Error
(Intercept)                                                 357.591     11.333
calluna_shoot_typeShort                                     -13.137      8.466
DroughtTrtExt (90)                                           18.262     15.783
ageClassPioneer                                             -15.413     15.697
calluna_shoot_typeShort:DroughtTrtExt (90)                   -1.199     11.699
calluna_shoot_typeShort:ageClassPioneer                      31.795     11.591
DroughtTrtExt (90):ageClassPioneer                           12.228     21.949
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer    2.492     16.071
                                                                df t value
(Intercept)                                                 12.529  31.552
calluna_shoot_typeShort                                    160.797  -1.552
DroughtTrtExt (90)                                          11.838   1.157
ageClassPioneer                                             11.578  -0.982
calluna_shoot_typeShort:DroughtTrtExt (90)                 159.123  -0.102
calluna_shoot_typeShort:ageClassPioneer                    158.538   2.743
DroughtTrtExt (90):ageClassPioneer                          11.096   0.557
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer 157.473   0.155
                                                           Pr(>|t|)    
(Intercept)                                                2.56e-13 ***
calluna_shoot_typeShort                                     0.12269    
DroughtTrtExt (90)                                          0.27006    
ageClassPioneer                                             0.34621    
calluna_shoot_typeShort:DroughtTrtExt (90)                  0.91852    
calluna_shoot_typeShort:ageClassPioneer                     0.00679 ** 
DroughtTrtExt (90):ageClassPioneer                          0.58852    
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer  0.87699    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) cll__S DrTE(90) agClsP cl__S:DTE(90) c__S:C DTE(90):
clln_sht_tS   -0.437                                                     
DrghtTE(90)   -0.718  0.314                                              
ageClassPnr   -0.722  0.315  0.518                                       
cl__S:DTE(90)  0.316 -0.724 -0.413   -0.228                              
clln_s_S:CP    0.319 -0.730 -0.229   -0.401  0.529                       
DrTE(90):CP    0.516 -0.226 -0.719   -0.715  0.297         0.287         
c__S:DTE(90): -0.230  0.527  0.300    0.289 -0.728        -0.721 -0.384  
performance::check_model(shoot_type_lmdc3, detrend = FALSE)

SLA

shoot_type_sla3 <- lmer(log(SLA) ~ (calluna_shoot_type * DroughtTrt * ageClass) +
                               (1 | DroughNet_plotID/plant_nr), 
                             data = calluna_shoot)
boundary (singular) fit: see help('isSingular')
summary(shoot_type_sla3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: log(SLA) ~ (calluna_shoot_type * DroughtTrt * ageClass) + (1 |  
    DroughNet_plotID/plant_nr)
   Data: calluna_shoot

REML criterion at convergence: -165.2

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.53673 -0.54758  0.09365  0.65546  2.24767 

Random effects:
 Groups                    Name        Variance Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.01298  0.1139  
 DroughNet_plotID          (Intercept) 0.00000  0.0000  
 Residual                              0.01584  0.1259  
Number of obs: 195, groups:  
plant_nr:DroughNet_plotID, 36; DroughNet_plotID, 12

Fixed effects:
                                                             Estimate
(Intercept)                                                 4.411e+00
calluna_shoot_typeShort                                    -3.502e-02
DroughtTrtExt (90)                                         -3.810e-02
ageClassPioneer                                            -1.140e-01
calluna_shoot_typeShort:DroughtTrtExt (90)                 -2.196e-04
calluna_shoot_typeShort:ageClassPioneer                    -2.262e-02
DroughtTrtExt (90):ageClassPioneer                          4.931e-02
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer  7.567e-03
                                                           Std. Error
(Intercept)                                                 4.811e-02
calluna_shoot_typeShort                                     3.866e-02
DroughtTrtExt (90)                                          6.685e-02
ageClassPioneer                                             6.642e-02
calluna_shoot_typeShort:DroughtTrtExt (90)                  5.344e-02
calluna_shoot_typeShort:ageClassPioneer                     5.294e-02
DroughtTrtExt (90):ageClassPioneer                          9.271e-02
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer  7.342e-02
                                                                   df t value
(Intercept)                                                 5.286e+01  91.684
calluna_shoot_typeShort                                     1.618e+02  -0.906
DroughtTrtExt (90)                                          5.002e+01  -0.570
ageClassPioneer                                             4.881e+01  -1.716
calluna_shoot_typeShort:DroughtTrtExt (90)                  1.601e+02  -0.004
calluna_shoot_typeShort:ageClassPioneer                     1.595e+02  -0.427
DroughtTrtExt (90):ageClassPioneer                          4.680e+01   0.532
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer  1.584e+02   0.103
                                                           Pr(>|t|)    
(Intercept)                                                  <2e-16 ***
calluna_shoot_typeShort                                      0.3664    
DroughtTrtExt (90)                                           0.5713    
ageClassPioneer                                              0.0925 .  
calluna_shoot_typeShort:DroughtTrtExt (90)                   0.9967    
calluna_shoot_typeShort:ageClassPioneer                      0.6698    
DroughtTrtExt (90):ageClassPioneer                           0.5974    
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer   0.9180    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) cll__S DrTE(90) agClsP cl__S:DTE(90) c__S:C DTE(90):
clln_sht_tS   -0.470                                                     
DrghtTE(90)   -0.720  0.338                                              
ageClassPnr   -0.724  0.340  0.521                                       
cl__S:DTE(90)  0.340 -0.723 -0.445   -0.246                              
clln_s_S:CP    0.343 -0.730 -0.247   -0.432  0.528                       
DrTE(90):CP    0.519 -0.244 -0.721   -0.716  0.321         0.310         
c__S:DTE(90): -0.247  0.527  0.324    0.312 -0.728        -0.721 -0.415  
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
performance::check_model(shoot_type_sla3, detrend = FALSE)

mean thickness

shoot_type_thickness3 <- lmer(mean_thickness ~ (calluna_shoot_type * DroughtTrt * ageClass) +
                               (1 | DroughNet_plotID/plant_nr), 
                             data = calluna_shoot)
boundary (singular) fit: see help('isSingular')
summary(shoot_type_thickness3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: mean_thickness ~ (calluna_shoot_type * DroughtTrt * ageClass) +  
    (1 | DroughNet_plotID/plant_nr)
   Data: calluna_shoot

REML criterion at convergence: -568.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-1.9497 -0.6137 -0.1651  0.4601  3.7269 

Random effects:
 Groups                    Name        Variance  Std.Dev.
 plant_nr:DroughNet_plotID (Intercept) 0.0004477 0.02116 
 DroughNet_plotID          (Intercept) 0.0000000 0.00000 
 Residual                              0.0021493 0.04636 
Number of obs: 195, groups:  
plant_nr:DroughNet_plotID, 36; DroughNet_plotID, 12

Fixed effects:
                                                             Estimate
(Intercept)                                                  0.239650
calluna_shoot_typeShort                                      0.050998
DroughtTrtExt (90)                                           0.011215
ageClassPioneer                                              0.060160
calluna_shoot_typeShort:DroughtTrtExt (90)                   0.013297
calluna_shoot_typeShort:ageClassPioneer                      0.004369
DroughtTrtExt (90):ageClassPioneer                          -0.028080
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer  -0.016295
                                                           Std. Error
(Intercept)                                                  0.012781
calluna_shoot_typeShort                                      0.014043
DroughtTrtExt (90)                                           0.017562
ageClassPioneer                                              0.017338
calluna_shoot_typeShort:DroughtTrtExt (90)                   0.019488
calluna_shoot_typeShort:ageClassPioneer                      0.019336
DroughtTrtExt (90):ageClassPioneer                           0.023980
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer   0.026881
                                                                   df t value
(Intercept)                                                 73.584914  18.751
calluna_shoot_typeShort                                    165.448585   3.632
DroughtTrtExt (90)                                          69.574798   0.639
ageClassPioneer                                             66.619031   3.470
calluna_shoot_typeShort:DroughtTrtExt (90)                 162.212261   0.682
calluna_shoot_typeShort:ageClassPioneer                    160.752230   0.226
DroughtTrtExt (90):ageClassPioneer                          63.480783  -1.171
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer 158.682618  -0.606
                                                           Pr(>|t|)    
(Intercept)                                                 < 2e-16 ***
calluna_shoot_typeShort                                    0.000375 ***
DroughtTrtExt (90)                                         0.525166    
ageClassPioneer                                            0.000918 ***
calluna_shoot_typeShort:DroughtTrtExt (90)                 0.496022    
calluna_shoot_typeShort:ageClassPioneer                    0.821518    
DroughtTrtExt (90):ageClassPioneer                         0.245976    
calluna_shoot_typeShort:DroughtTrtExt (90):ageClassPioneer 0.545240    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) cll__S DrTE(90) agClsP cl__S:DTE(90) c__S:C DTE(90):
clln_sht_tS   -0.633                                                     
DrghtTE(90)   -0.728  0.461                                              
ageClassPnr   -0.737  0.467  0.536                                       
cl__S:DTE(90)  0.456 -0.721 -0.612   -0.336                              
clln_s_S:CP    0.460 -0.726 -0.335   -0.598  0.523                       
DrTE(90):CP    0.533 -0.337 -0.732   -0.723  0.448         0.433         
c__S:DTE(90): -0.331  0.522  0.443    0.430 -0.725        -0.719 -0.583  
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
performance::check_model(shoot_type_thickness3, detrend = FALSE)